Seperate uniq isSorted logic into helper

Separate the `isSorted` logic for `uniq` into a separate function (https://github.com/megawac/lodash/commit/c87336a6ad92bfbe36a24bb4e2b1f342ec8ad75b#commitcomment-6989109)