Use mkstemp instead of deprecated tmpnam.

Gets rid of the warning you get when compiling the compiler.