Return the number of locks acquired when locking

The count is an absolute count from the caller's perspective.