BUG: Fixes #2799
Use `np.sort` instead of `sorted` when the input is a list and no indices
are requested. Fixes #2799.
Merge pull request #4344 from jaimefrio/unique-sort

BUG: Fixes #2799