ruby core: add missing g_strdup()

Both key and value should be duplicated because the GHashTable hash
g_free() as key_destroy_func and value_destroy_func.