IMPALA-1411: Create table as select produces incorrect results

This commit fixes the issue where a CTAS statement inserts a wrong
number of rows if the associated select statement contains an inline
view with a limit clause. The limit clause of the nested query was not
taken into consideration during planning, resulting in the generation
of a wrong distributed plan.

Change-Id: Ib3ad50199d95d2d6b9ad0aa3b2031a002cbcca44
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5057
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: jenkins