ENH: optimize np.where via nditer with external loop

Implementation via PyArray_Choose is very slow, a direct implementation
is 10 times faster.
Optimizing Choose is more complicated due to its higher complexity and
would require specialization for optimal np.where anyway, but it is
something that could be done in future.
ENH: improve new where function

Allow object and zerosized iteration and move bool casting of mask into
the iterator logic and improve tests appropriately.
MAINT: add an explicit check on zero iteration
MAINT: move array creation earlier and use goto for deallocs
ENH: release GIL during where iteration
Merge pull request #4182 from juliantaylor/where-improve

ENH: optimize np.where via nditer with external loop