Switch to rw mode before file operations on RFC2136 cache. Fixes #3201