DRILL-7456: Batch count fixes for 12 operators
Enables batch validation for 12 additional operators:
* MergingRecordBatch
* OrderedPartitionRecordBatch
* RangePartitionRecordBatch
* TraceRecordBatch
* UnionAllRecordBatch
* UnorderedReceiverBatch
* UnpivotMapsRecordBatch
* WindowFrameRecordBatch
* TopNBatch
* HashJoinBatch
* ExternalSortBatch
* WriterRecordBatch
Fixes issues found with those checks so that this set of
operators passes all checks.
Includes code cleanup in many files touched during this
work.
closes #1906