Newly created cache directories does not include the version.txt file
### System Info

- `transformers` version: 4.22.2
- Platform: macOS-11.7-x86_64-i386-64bit
- Python version: 3.9.13
- Huggingface_hub version: 0.10.0
- PyTorch version (GPU?): 1.12.1 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no

### Who can help?

@sgugger

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Steps to reproduce this behaviour:
1. Start with a clean machine with no cache directories at all
2. Download a pre-trained model (in our case, a clip model) to create the cache directory and download model files
```
from transformers import CLIPModel
from transformers import CLIPProcessor

model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
processor CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
```
3. Notice there is no `version.txt` file there under the `hub` directory causing transformers library to assume it's an older version of the cache

### Expected behavior

Upon creation of the cache directory a `version.txt` should be created to indicate it is the correct version of the cache system.

For context, we are taking a copy of the cache folder and saving that for later use in production under a read only system for faster startup times. As we don't want the box to startup and download a pretrained model every time. However this issue has caused the transformers library to always want to write/migrate the cache as it thinks it is on an older version.
Thanks for reporting! I can reproduce and the PR above fixes the problem normally.