Closing one end of a stream_socket_pair causes other end to report EOF.

Fixes issue #1730.