Catching NoMethodError for force_encoding not being available on Ruby 1.8.7 and also catching Errno::EAGAIN on listener.read