fix out-of-bounds check in lock_dbg_cb (was too lose to detect all