Control creation and lifespan of temporary files and directories in unit tests