Introduce the CacheFileUtils helper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes (refactoring)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT
| Doc PR        | n/a

Some clients use ConfigCache only for its ability to atomically write into a file.

The PR moves that code into a helper class.

It's a pick off #7230.