Backport PR #38057: PERF: fix regression in creation of resulting index in RollingGroupby
Backport PR #38057
@jorisvandenbossche there were several merge conflicts. If you can give this a quick once over before I merge.

location of tests are different `pandas/tests/window/test_groupby.py` vs `pandas/tests/window/test_grouper.py`
changes to `test_groupby_rolling_nan_included` not needed, added in #36842 and not on 1.1.x
class hierarchy has changed, changes to `_apply` in `RollingGroupby` instead of `BaseWindowGroupby`
