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,
which results in a single (non-ufunc) comparison that doesn't trigger any warnings.