Fix Attempt to unlock mutex that was not locked.

According to Debian bugzilla https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758619#63
Seen it on Debian sid.