Add predicate locks support in check_locks

Add support for predicate locks.