Ruby: Fix connection thread safety issue

That should do it :)

Little change: tokens are now generated per connection, and not globally.