BUG: Fix NaN handling in npy_ObjectMax and npy_ObjectMin.

These functions currently fail randomly for Python < 3.x because they
use PyObject_Cmp, which looks at addresses for NaN objects. The fix is
to use PyObject_RichCompareBool, which is available in Python >= 2.6.
Note that for Python 2.6 and 2.7, PyObject_RichCompareBool falls back on
PyObject_Cmp when an object doesn't provide rich compare.

Closes #4903.
TST: Add tests for maximum/minimum of object arrays with nan.

There is a random element to these tests, so that they may fail to
fail when python compare is being used instead of richcompare.
Merge pull request #4982 from charris/gh-2941

Fixup of PR #4921