IMPALA-847: Remove duplicate gby and agg exprs at the beginning of agg analysis.

The bug was that indexes into the agg tuple were computed incorrectly
for sum(distinct) or avg(distinct) because of duplicate group by exprs
that were removed in some places but not others.

Change-Id: I52c8ee4fbc8a09fd3204f5af47471e8c3af7d7e9
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1725
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins