BUG: close file-like objects returned by urlopen

Fix `ResourceWarning: unclosed file` on Python 3

Please backport to 1.8