Socket/pipe

This catches the `send: resource vanished (Broken pipe)` exception.

The socket is also more courteous and will close on unload.