Add support for cancellation to `ReadWriteLock`.