Replace tempnam with mkstemps.
Remove unused include.