Compare z_teardown_lock with FreeBSD and make it identical, ensuring
consistent lock type.