Ensure all fclose() operations do not happen on NULL pointers