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 Name Job ID Coverage
  Build
passed cross-android_api21_arm64 #221896

00:03:30

passed cross-android_api28_arm64 #221897

00:03:26

passed cross-mingw64 #221898

00:03:41

passed fedora-x86_64 #222123

00:05:17

passed msys2-mingw32 #221899
win32

00:11:40

passed vs2017-x64 #221900
win32

00:08:19

failed fedora-x86_64 #221955

00:04:21

failed fedora-x86_64 #221938

00:04:05

failed fedora-x86_64 #221895

00:05:02

 
  Coverage
passed coverage #221901

00:04:12

74.2%