net: throw on write after close

`socket.write()` on a closed socket will either throw or pass an error to the callback.

see https://github.com/joyent/node/pull/7623#issuecomment-43895947