socket/pure_ruby: fix Ruby 1.8 compatibility