[STORE] Add dedicated method to write temporary files

Recovery writes temporary files which might not end up in the
right distributor directories today. This commit adds a dedicated
API that allows specifying the target file name in order to create the
tempoary file in the correct directory.
can we also assert so the failure message will include the offending file? I think it will be easier to trace that the alternative of looking for it in the logs..