handle NaN case nicely in _is_sorted

Previously, the `>=` comparison would cause a
"RuntimeWarning: invalid value encountered in greater_equal".

Here, `np.amin` propagates NaN values appropriately
and doesn't cause the warning to throw.