https://bugs.openldap.org/show_bug.cgi?id=10058
--- Comment #1 from jiri.novosad@gmail.com --- I came across this bug when using Heimdal with the hdb-mdb backend, see https://github.com/heimdal/heimdal/issues/1090.
The easiest "fix" would be to destroy the mutexes only on FreeBSD, document this and tell the FreeBSD ports maintainers.