glib2: use rb_str_new_cstr
glib2: add rb_gc_register_mark_object() check