Introduce a rwlock for write operations for dump

Introduce a rwlock for write operations to avoid taking lots of read locks during dump operation