Calling fclose() on a NULL filehandle on win32 causes an assertion to fail