Minor patch to creation of temporary caches.
Change the creation/writing of the temporary file necessary for lalcachesrc which uses NamedTemporaryFile.
This will allow temporary files to be written to the correct temporary directories, and to be automatically removed under certain conditions.
Additionally, add support for automatic creation of output directory paths.