codegen: Only emit declaration of *_register_type if needed
codegen: Only emit declaration of *_register_type if needed

This allows to add a test case for ModuleInit with -Werror=redundant-decls

GNOME/vala,frida/vala,GNOME/vala,frida/vala,GNOME/vala,frida/vala,frida/vala,GNOME/vala,frida/vala