extract.c: replace tempnam() with mkstemp() on non-Windows