ImageInput close/dtr leaving files open fixes

* For a couple formats, the ImageInput dtr didn't automatcially close() the
  file if it was still open.
* For a couple formats, a redundant call to close() might have strange
  effects because it didn't double check that the file was open.

I'm pretty sure that the docs don't say anything that would guarantee that the ImageInput dtr will close a file if still opened (without an explicit call to close by the app). But almost all of them did call close automatically upon destruction.  This just fixes the few that did not.