mingw: do not crash on open(NULL, ...)