fix: make overwriting of archive files atomic
Generate files (with temporary name) directly in the dest dir instead of /tmp
and rename them afterwards.
This is to avoid that consumers read those files while they are half-written.
(moving files across file-systems is not atomic)
Signed-off-by: moson-mo mo-son@mailbox.org