read_hdf closes HDF5 stores that it didn't open.
- [ ] closes #28699
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This commit fixes #28699. I added a test for the bug.