Make PageCache.flush take read-locks

It used to take write-locks, but this brings it in line with PagedFile.flush, which already only takes read-locks.
Pessimistic read-locks are good enough, because the `dirty` flag is only ever set to `true` under a write lock.