Write timeout

Writes will block indefinitely without timeout if the socket's write buffer space is exhausted and the host is unreachable. This happens in EC2 when a connection has been closed and is idle for more than 60 seconds.

I couldn't figure out a way to simulate host unreachable (as that probably requires going into the OS' tcp layer), so I added a kinda disgusting test using monkeypatching. Any suggestions on how to make it less disgusting?