Catching NoMethodError for force_encoding not being available on Ruby 1.8.7 and also catching Errno::EAGAIN on listener.read
Merge pull request #3 from rtucker-mozilla/master

Fix compatibility with Ruby 1.8