Make sure our foo_get_type functions are thread-safe

While debugging:
https://bugzilla.redhat.com/show_bug.cgi?id=866718

I found a thread-safeness issue with a couple of foo_get_type functions
in polkit causing this crash.

After this I decided to check if spice-gtk has the same issue, and it does,
since foo_get_type can be called from different threads, it is important to
make them thread-safe.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>