Fix disconnection bug.
* Socket timeout was not being caught because it would throw a socket.error
instead of a socket.timeout. This seems like a bug in Python's sockets.