MAINT: Make setting mask values with scalars faster.

The current implementation assigns the mask value to a.flat, where a is
the mask being updated. In the scalar case, that is slower than
assigning to a[...], so when a is an instance of int, float, np.bool_,
or np.number use that instead.
Merge branch 'fast-mask'

* fast-mask:
  MAINT: Make setting mask values with scalars faster.