Added backwards compatibility with Redis 2.2.2 because it plays nicer with Ruby 1.8.7's Socket library.
Eliminated infinite loops and added a proper timeout setup to prevent hanging.