IMPALA-165: Optimization for queries processing only few rows.

This patch optimizes queries processing few rows by forcing them to be
executed on a single node with codegen disabled (and with just one
scanner thread if the threshold is below the batch size).  If a limit
clause is present in the query, this limit is chosen over the input
cardinality if it can be directly applied on a scan node. If it is not
possible to get the maximum with confidence, i.e. because of missing
statistics this optimization will not be applied

This behavior is controllable with the new query option:

     EXEC_SINGLE_NODE_ROWS_THRESHOLD

that has a default value of 100.

Change-Id: I738206798f1fa54c5f076acee11bef7be2bd0eb3
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4822
Reviewed-by: Martin Grund <mgrund@cloudera.com>
Tested-by: jenkins