ENH Check array equality in C

This is about twice as fast as doing it in Python for equal arrays, and
possibly 1000x faster in case of early exit.