Fix tempnam deprecation warning