tests: use mktemp in a portable way

Without a template. mktemp fails on MacOSX