ch-image: cached pull followed by non-cached pull breaks multiple sub-commands
Reproducer:
```
$ ch-image pull alpine:3.18
$ ch-image pull --no-cache alpine:3.18
$ ch-image delete alpine:3.18
fatal: not a git repository: '/var/tmp/reidpr.ch/img/alpine+3.18/ch/git'
error: command failed with code 128: /usr/bin/git checkout 1eeb075b
trace: charliecloud.py:588:cmd_base, charliecloud.py:624:cmd_stdout, build_cache.py:1012:git, build_cache.py:1243:unpack_delete, misc.py:65:delete, ch-image:361:main
$ ch-image modify -i -- alpine:3.18 tmpimg
copying image from cache ...
fatal: not a git repository: '/var/tmp/reidpr.ch/img/alpine+3.18/ch/git'
error: command failed with code 128: /usr/bin/git checkout --detach
trace: charliecloud.py:588:cmd_base, charliecloud.py:624:cmd_stdout, build_cache.py:1012:git, build_cache.py:780:branch_nocheckout, modify.py:100:main, ch-image:361:main
```
To recover, manually delete the image:
```
$ rm -Rf $CH_IMAGE_STORAGE/img/alpine+3.18
```
issue