[SPARK-2967][SQL] Fix sort based shuffle for spark sql.

Add explicit row copies when sort based shuffle is on.
Hi, don't we need to copy `hashExpressions(r)` here?