[SPARK-4673][SQL] Optimizing limit using coalesce

Optimizing limit using coalesce to avoid shuffle.