Fixing network exception handling

We use the usual SocketWouldBlock and SocketClosedRemote now
(rather than checking for the exception messages to contain
magic strings, as was required in some places in RepyV1.)