glib: Fix memory overwrite in translate-to-foreign for variant cstructures