Don't exit on read errors on socket

Closes the socket instead of doing an exit when a read
error occurs on the socket.