Fix mutex on FreeBSD