gproject: Don't use g_hash_table_iter_replace() and g_hash_table_contains()

These functions aren't available on systems with older glib versions.