Prevent gnome-xml from writing two copies of the xml tree to the dest file in xmlSaveFile, and free the allocated buffer there