Replace tmpname() by mkstemp() on non-MSVC compilers