Remove use of non-errno error codes in OSNetworkSystem.

This code's confusing enough without being so idiosyncratic. I've also changed
the native method so it returns a boolean rather leaking errno values in Java.

Where the original code used ENOTCONN, I've reverted to the native API's
EINPROGRESS for clarity. I've also used TEMP_FAILURE_RETRY to avoid manually
messing about with EINTR.

While I was here, I fixed a TODO about not needlessly passing a
sockaddr_storage by value, and removed a dead part of the old getsockopt code
I'd forgotten to remove.

Change-Id: I3c62fb80e33747619961ff39a0867422769126c4
4 files changed