...in this case, I think it's cleaner to call `mkstemp` and close the fd, up where we currently have mktemp, rather than using NamedTemporaryFile down here.