Check whether file handle is valid

This eliminates an assertion under Windows that occurs when an archive cannot be
opened.