IMPALA-1203: Correlated agg subquery may be incorrectly rewritten if it
has a LIMIT clause

This commit fixes the issue where a correlated subquery with a LIMIT
clause produces wrong results. Correlated IN and EXISTS subqueries are
rejected if they contain a LIMIT clause because there is no correct
rewrite. For correlated agg subqueries the LIMIT clause is removed
because it does not affect the results.

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