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

@socket.close() may raise "IOError: closed stream" when the connection has
abruptly closed.
Merge pull request #2276 from nviennot/ruby_socket_close

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