[entropy.locks] use TLS for reentrancy safety checks, update tests