[BUG] maybe_upcast_putmast also handle ndarray
-  closes #23823
-  2 tests added
-  passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
-  whatsnew entry

Follow h-vetinari's footstep. `maybe_upcast_putmask` was left untouched in #25425. Try to fix the bug so that `maybe_upcast_putmask` can also handle `ndarray` as well as `Series`.
