ENH: add max fastpath to partition for nan detection

Allows low overhead check for NaN via isnan(partition(d, (x, -1))[-1])
Merge pull request #4347 from juliantaylor/partition-max

ENH: add max fastpath to partition for nan detection