Clean up file handle management.
The main reason fclose() could fail is if the file is open for writing,
not all the buffered data has been written out at the time fclose() was
called, and the attempt to write it out fails. In any case, the file
handle is no longer valid after fclose() completes, whether the close
succeeds or not, so there's no reason to keep it around.
There's no reason to check whether it's null in a loop called in code
where it's not null to start with and where it's not set to null in the
loop.
This should fix CID
1374111.
Change-Id: Ib8067a17731b41d6b184a5a415addc2ecaa7c00c
Reviewed-on: https://code.wireshark.org/review/18359
Reviewed-by: Guy Harris <guy@alum.mit.edu>