[LLDB][NFC] Reliability fixes to TCPSocket code

Patch the following issues found by static code inspection:
- Unchecked return values from lib calls
- Passing potentially negative arg into a function that requires non-negative input
- Possible socket double-close

Differential Revision: https://reviews.llvm.org/D131294

GitOrigin-RevId: aa4977f2e1354bb5e1937235dd12199839ab0801
1 file changed