IMPALA-1106: AnalysisException: Table does not exist, when using deeply
nested WITH clauses

This commit fixes issue IMPALA-1106 in which an analysis error is thrown
when there are deeply nested WITH clauses. There were two issues: a) the
hierarchy of analyzers was not properly constructed in the presence of
deeply nested WITH clauses and b) cloning a WITH clause was not
discarding the analysis state of the associated QueryStmts.

Change-Id: I3b40213dcbd082e90e54eaacc990850dfa5437e4
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3773
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3786
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>