codegen: use #if GLIB_CHECK_VERSION for init functions

Tarballs with generated code should compile without warnings, and work
with various versions of glib (assuming the rest of the code is
correctly up to date, which is often the case if you don't use newer
functions)

https://bugzilla.gnome.org/show_bug.cgi?id=692218