IMPALA-1584, IMPALA-1585: Bug fixes on Sorter to avoid crashes on low memory

This patch fixes a few problems in the Sorter code. In particular:

(a) The AddBatch() function was not checking the return of the templated AddBatch<>()
function, and it would proceed trying to sort a run even though errors had occured,
leading to crashes.
(b) The Sorter was trying to use the vector of var-len blocks even if that was empty,
because the initial allocation of blocks had failed.
(c) The constructor was calling a couple of functions of the block manager that could
fail, especially in low memory situations.

This patch adds error checks and moves the constructor's code that may fail to a separate
Init() function that must be called right after the Sorter object is constructed.

It also adds a new type of memory scaling test that makes sure that TPC-H Q1 either
executes correctly or gracefully fails in a set of relatively small mem limits.

Change-Id: Ia2846839472bde33fc37955474a0c3c574d1cce0
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5526
Reviewed-by: Ippokratis Pandis <ipandis@cloudera.com>
Tested-by: jenkins