BUG/REF: Refactor BaseWindowIndex so groupby.apply has a consistent index output
- [x] closes #39732
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

lgtm. can merge on green. CI failures were related to the timedelta issue that has already been fixed