Instrument lock or unlock coarsely for records

We previously add the lock in the addEntryCache function, which can not
guarantee the load/store sequence. Now we rely the coarse lock to make
it possible.