[SPARK-2534] Avoid pulling in the entire RDD in groupByKey.

This should go into both master and branch-1.0.
We should change all of them actually. I will update the PR.