Ruby: reconnect() no longer dies when closing the old connection

@socket.close() may raise "IOError: closed stream" when the connection has
abruptly closed.