Simplify and robustify Util::keyfile_save
Simplify and robustify Util::keyfile_save

The previous implementation was deleting the keyfile and then
trying to write to it. This means we can endup with an empty/partial
keyfile if an error occurs during the writing. g_file_set_contents
will write to a temporary file and then atomatically replace the
existing file which is much better. This also makes this function
shorter.

https://bugzilla.gnome.org/show_bug.cgi?id=683558

vbenes/gnome-boxes,vbenes/gnome-boxes