Write to a cache atomically as a pre-caution