RUBY-532 fix for threading issue in socket pool