Remove unused variables
Check for encoding and arity for 1.8.7 and jruby

In Ruby 1.8.7 Zlib::GzipReader.wrap has arity -1 but does not support
encoding so both feature checks must be made.

See also #472