Make zedrem replace file contents atomically

This changes the behavior of zedrem to update files atomically using a
temp file and renaming it to the correct name. This is strictly safer
than the previous behavior which wrote to a temp file and then
overwrote the existing file. If someone killed zedrem in the middle of
this operation or power was lost suddenly you could have inconsistent
state (or totally missing file data).

This new design ensures you will either have the new data or the old
data.