[SPARK-3408] Fixed Limit operator so it works with sort-based shuffle.