We want FILE* here, instead of a plain fd. Let's generalize this in tmpfile-util.c, so we can reuse it later easily.
This splits out a bunch of functions from fileio.c that have to do with temporary files. Simply to make the header files a bit shorter, and to group things more nicely. No code changes, just some rearranging of source files.