make_tempfile() shared by views/tests. Close file descriptor in finally clause.