Add various function parameter guards to the GSource functions

Especially check that the GSources passed to functions have a non-zero,
positive reference count.
10 jobs for gsource-api-guards in 33 minutes and 12 seconds (queued for 2 seconds)
latest
Status Job ID Name Coverage
  Build
passed #221896
cross-android_api21_arm64

00:03:30

passed #221897
cross-android_api28_arm64

00:03:26

passed #221898
cross-mingw64

00:03:41

passed #222123
fedora-x86_64

00:05:17

passed #221899
win32
msys2-mingw32

00:11:40

passed #221900
win32
vs2017-x64

00:08:19

failed #221955
fedora-x86_64

00:04:21

failed #221938
fedora-x86_64

00:04:05

failed #221895
fedora-x86_64

00:05:02

 
  Coverage
passed #221901
coverage

00:04:12

74.2%