fix mutex lock-unlock sequence typo

causing segfault on freebsd since glib 2.32