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

Optimizing limit using coalesce to avoid shuffle.
You do need to `copy()` before any `take` or `collect` operation because SparkSQL will reuse row objects and these operations create arrays that will end up all containing the same object.