Handle timeouts. These can happen when we're sending data over TCP and
are waiting for the server to acknowledge, but the response gets lost somewhere.

We need to reconnect after we've timed out in order to flush delayed responses.
Merge pull request #42 from campanja/handle-timeouts

Handle timeouts