Fix redirected input support with Ruby 2.0

Really quick turnaround at https://bugs.ruby-lang.org/issues/9067,
thanks Akira Tanaka!