withWriteLock
Run the given block of code while holding the write lock. Only one coroutine at a time may run under the write lock, and no readers are active while it runs. Must not be called from a coroutine that already holds the read or write lock on this instance — see the class-level KDoc for reentrancy warnings.