If we can't create the tmp directory, use tempfile to make one.