Use tmpfile() instead of tmpnam()