Updater: do not write db.xml.gz directly

In case something goes wrong during writing it, we should not leave
the user with an invalid file. Rather, write to a temporary file and
rename it upon success.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>