[SPARK-3032][Shuffle] Fix key comparison integer overflow introduced sorting exception

Previous key comparison in `ExternalSorter` will get wrong sorting result or exception when key comparison overflows, details can be seen in [SPARK-3032](https://issues.apache.org/jira/browse/SPARK-3032). Here fix this and add a unit test to prove it.
Well, if the test data is not enough, please add suitable test data! You got an exception in your reported version of this error, right? I think it's fairly easy to add suitable data, just put integers that include Int.MaxValue and MinValue and such (or other extreme integers). You can use a custom class with a configurable hash code (we have one in our test suites). Otherwise this is just testing that the Ordering is different.