Calling fclose on a NULL filehandle on win32 causes an assert()