network: fix double-free using libnm function filter_connections()
Based-on-patch-by: Thomas Haller <thaller(at)redhat.com>
The libnm functions nm_{device,access_pointer}_filter_connections()
return ownership of a newly create GPtrArray, which also owns the
content by having the g_ptr_array_set_free_func() function set to
g_object_unref().
Consequently, this functions should be annotate with "(transfer
container)" or "(transfer full)", but various bindings treat that
differently. To make pygobject happy, it would require "(transfer
container)", but that breaks vala (and vice versa).
This leads to a double-free and a crash in anaconda.
This is not really fixable in libnm. But the workaround is simple.
Let's just not use these functions.
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/b012877445bddd772eec79e3ce38f93cc40de720
See-also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/305
Resolves: rhbaz#1873561