Only attempt to close '_peakfile_fd' if we have a valid handle