As far as I know, std::tmpfile is the only way to get both atomic unique name generation / file opening and auto-deletion.

I would write a streambuf wrapper, it's a very legitimate case for one. Or, to write less code, you could use fileno() (on a POSIX system) or whatever Windows has to get a HANDLE from FILE*, and then construct a boost.iostreams file_descriptor stream.