Close the socket if close() is called when we're still waiting for a handshake.