BUG: Fix lack of NULL check in array_richcompare.

The lack of this check led to a segfault.

Closes #4613.