g_dbus_error_register_error_domain: use a mutex instead of g_once

Closed Alexander Richardson requested to merge arichardson/glib:dbus-g-once into main

We can't use g_once_init* here since quark_volatile is a gsize* which is not guaranteed to be the same as a gpointer* and changing the parameter to guintptr* would be an API break.

As an optimization, we could use atomics to load gsize before acquiring the mutex but there is no g_atomic_* API for gsize, so this would require compiler builtins/C11 and this is unlikely to be performance critical, so just lock unconditionally.

Helps: #2842

Merge request reports