Fix exception thrown when closing already closed socket.

Also revert to returning ConnectionClosed for 'Connection reset by peer' cases.