add mkstemp implementations for tests on Windows