BUG: Fix .rolling().mean() reassignment returning NaNs (pandas-dev#61841)

This pull request resolves a bug highlighted in issue [[#61841](https://github.com/pandas-dev/pandas/issues/61841)](https://github.com/pandas-dev/pandas/issues/61841), where reassigning the result of `.rolling().mean()` to the same column in a DataFrame results in all-NaN values after the first assignment.

#### 🔜 Root Cause:

The root cause was improper alignment when using the `step` parameter within the `Window._apply()` function. The rolling results were sliced using `self.step` before being fully aligned with the original index, which caused mismatches in the returned Series/DataFrame.

#### 🔧 Fix Implemented:

* Adjusted the logic in `Window._apply()` to apply `self.step` only after the result is completely constructed and aligned.
* Moved `Series` and `DataFrame` imports from inside a type-checking block (`if TYPE_CHECKING`) to the top of the file. This eliminates pre-commit CI errors related to inconsistent namespace usage.

#### 📄 Verification:

The fix was verified by executing:

```python
import pandas as pd
import numpy as np

df = pd.DataFrame({"Close": np.arange(1, 31)})
df = df.copy()
df["SMA20"] = df["Close"].rolling(20).mean()
df["SMA20"] = df["Close"].rolling(20).mean()
print(df.tail())
```

This now works as expected, and outputs the correct rolling mean values.

All relevant pre-commit hooks and CI checks pass after the changes.

---

Thank you for reviewing this fix!
Thanks for the PR, but please contain the changes to one open pull request at a time