gi: support non GObject struct as return value

GitHub: fix #286

Reported by Christopher L. Ramsey. Thanks!!!