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.
adding test case for #2744
Merge pull request #2744 from perimosocordiae/patch-1

handle NaN case nicely in _is_sorted