Use the GetTempDir() method instead

sys_get_temp_dir might not be available, and we should use the
tempdir config consistently.