keyfile: cleanup _internal_write_connection()
- use gs_free instead of explicit free(). - use nm_streq*() instead of strcmp(). - move deletion of existing file after we successfully wrote the new file. - add parameter existing_path_readonly, to avoid to overwrite or delete the existing path (if it exists). This is still mostly unused, but will be necessary when we have read-only directories.
Showing with 35 additions and 27 deletions