add mkstemp implementations for tests on Windows
try to fix packaged_task issues