app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous version of the file by incomplete contents. So run g_output_stream_close() with a cancelled GCancellable to do so. See also discussion in #2565.
Showing with 141 additions and 25 deletions