support gets-with-limit from ruby 1.9

Used by 1.9.3 CSV module.  See http://www.ruby-doc.org/core-1.9.3/IO.html#method-i-gets and https://github.com/rubyspec/rubyspec/blob/master/core/io/gets_spec.rb