gobject-introspection: fix non-/usr/local installs

This allows GTK+ to install on my machine.

Closes #29014.