BUG: CoW not tracking references when indexing midx with slice
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

I think https://github.com/pandas-dev/pandas/pull/51895 will (as a side affect) also fix this. But of course should merge at least the test anyway. I guess we should merge this anyway since we'll backport CoW fixes? Given that the other PR is fixing an annoying bug for geopandas, I was kind of planning to backport that as well (but yeah, the order of which gets merged first doesn't matter, fine to already merge and backport this) Lets get this into the rc to be save