ccode: Fix typo and actually check "end_decls"
ccode: Fix typo and actually check "end_decls"

Note both begin_decls and end_decls must be either not null or null.

Fixes https://gitlab.gnome.org/GNOME/vala/issues/672

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