WIP: Add various function parameter guards to the GSource functions
Especially check that the GSources passed to functions have a non-zero, positive reference count.
See !675 (comment 439145) for previous (unresolved) discussion. I'll remove the first commit once the other MR is merged.
Edited by Sebastian Dröge