Merge branch 'wip/lantw/fix-gtestdbus-crash-on-freebsd'

Manually rebased.

https://gitlab.gnome.org/GNOME/glib/merge_requests/251