If this lock becomes a bottleneck at some point, I think we could split it for most cases (e.g., by hashing the key onto a set of locks).

The main complications would be: (1) `cache_process` would need to get all the locks, and (2) we would have to always use the same one to protect `append_recno`.  It isn't clear to me whether `append_recno` needs to use the same lock at the moment.