gunixmounts: Make GUnixMountMonitor thread-safe
The Nautilus test suite often crashes with GLib-FATAL-CRITICAL: g_source_is_destroyed: assertion 'g_atomic_int_get (&source->ref_count) > 0' failed
if it is started with GIO_USE_VOLUME_MONITOR=unix
. This is because GUnixMountMonitor
is simultaneously used from multiple threads over GLocalFile
and GVolumeMonitor
APIs. Let's add guards for proc_mounts_watch_source
and mount_poller_time
variables to prevent those crashes.
Fixes: #2030 (closed)