gobject-2.0: make TypeClass non-reference-counted

The ref function was always broken and would generate invalid C, so
this should be safe.

Fixes bug 679481.