BUG: where gives incorrect results when upcasting (GH 9731)
closes #9731

The main issue is when the destination and source arrays have different lengths, `np.putmask` doesn't behave like `arr[mask] = values`:

"Sets `a.flat[n] = values[n]` for each n where `mask.flat[n]==True`"

We have to use `np.place` instead. A secondary issue is that `np.place` doesn't automatically convert an integer to a `datetime64` like `np.putmask` does (I created a numpy issue for this), so we need an additional check for that case. The rest of the commit is just cleaning up `_maybe_upcast_putmask`, which had some parameters that were never used, and a confusing docstring.

@evanpw thanks!

this was subtle!
 I assume you changed to use `np.place` because some OTHER tests were initially failing on your change. Or do we need some tests for the same operation but with dtype = `M8[ns]` or `m8[ns]`?

if so, can you do a pr with those?
 The tests that were failing after I changed `np.putmask` to `np.place` were the ones testing `idxmax` and `idxmin`, but the new tests in GH #9804 are more direct.
