Sort shuffle read improvements

Hi @sryza , I've done some improvements in current SortSHuffleRead, would you mind help reviewing this and give me some comments, thanks a lot!

1. copy memory shuffle block from off-heap to on-heap if memory is allocated with direct memory to control the off-heap memory size.
2. Some code style modification and better failure processing logic.
Could the problem be that foreach is missing a parameter?

Does
    (0 until mergeFactor).foreach { x=>
      blocksToMerge += onDiskBlocks.take()
    }
work?