Locking in rlm_detail