CLN: Share code between _BytesTarFile and _BytesZipFile
- [x] xref #47136
- [x] [Tests added and passed]
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Needs some more work (test case + whatsnew) but want to first check whether the CI is happy. `_BytesTarFile` caused ValueErrors (due to inheriting from two IO classes?).

Would also like to further clean up `_BytesTarFile` and `_BytesZipFile` but that might be a separate PR.
Will submit a bug-fix after this PR is merged. can you add some minimal testing for this & whatsnew note > ok let's merge this, then do the appropriate backport (also prob need a whats new for 1.5 / different one for 1.4.3)

It fixed a bug in the not-yet-released tar feature. Does this need a whatsnew "even better tar support ;)"?

Will add a test. right the note is about the propagating closing errors (don't need anything for changes on unrejeased) > right the note is about the propagating closing errors (don't need anything for changes on unrejeased)

I changed this PR to still catch the error (if used within `get_handle`, the test calls the class directly). A follow-up PR (for main+1.4) will then remove the try-catch. See https://github.com/pandas-dev/pandas/pull/47160#issuecomment-1140451661 > I changed this PR to still catch the error

should probably update title. > > I changed this PR to still catch the error
> 
> should probably update title.

@twoertwein can you do this and then merge when ready.