driver: handle write error better
driver: handle write error better

We would previously simply assume that the write would always succeed.  However,
write(2) may return -1 for error as well as fail to perform a complete write (in
which case the returned number of bytes will be less than the requested bytes).

Explicitly check if an error condition is encountered.  This would previously
not be caught as we default initialized success to true.  Add an assertion that
we always perform a complete write (a continuous retry could be added to ensure
that we finish writing completely).

This was caught by GCC's signed comparison warning and manual inspection.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@217355 91177308-0d34-0410-b5e6-96231b3b80d8

apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb