[SPARK-2650][SQL] Build column buffers in smaller batches

@marmbrus @liancheng It's great to see we will support the smaller batch processing in `InMemoryRelation`, but Ideally, we can rewind the bytebuffers in the beginning of each iteration in `InMemoryRelation` during the  runtime, the whole detail should be transparent to the iterator in `InMemoryColumnarTableScan`. In this way, I think we can keep most of the code unchanged in `InMemoryColumnarTableScan`  then.