Fix the memory leak and actually close the resources.

This should fix https://github.com/jruby/jruby/issues/1888

I've opted for direct rename of getInputStream => openInputStream which technically can break people depending on it in 1.7.13 but in reality I doubt anyone started using that interface.

But I guess I can add a deprecated getInputStream back.