Conditionalize use of g_mutex_* and g_cond_*