Rework reader/writer locks, fix BtLockParent usage