Remove duplicated code

We preivously had two copies of ::BytesAvailable with only trivial
differences between them, and fixes have been applied to only one of
them.

Instead of duplicating the whole function, hide the FD_SET differences
behind a macro.  This leaves only one small __APPLE__-specific #if
block, and fixes ^C on non-__APPLE__ platforms.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@210592 91177308-0d34-0410-b5e6-96231b3b80d8
Added gdb-remote test to verify M memory write.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@210594 91177308-0d34-0410-b5e6-96231b3b80d8
Merge upstream llvm.org r210594 into dev-tfiala-native-protocol-linux-x86_64
Added llgs M write hex bytes support.