Partially revert "Remove specialized sort! method for PartialQuickSort{Int} (fixes #12833)" (#31632)
This reverts commit 9e8fcd30e9d7d4e88e94cfebec59778a71387b97, except for the
test. The underlying issue(s) causing #12833 seem to have been fixed with recent
changes in inference.