Run fn against a temporary path and publish the result only on success.
fn
Final path the caller wants.
Receives the temp path to write to. Its return value is passed through unchanged.
when target cannot be written atomically.
target
Run
fnagainst a temporary path and publish the result only on success.