RUBY-550 fix for dirty socket on external timeout
RUBY-556 fix potential deadlocks with broadcast