clean up the locking for the ByteRangeIndex and update locking
related commments.