SPARK-2226:  transform HAVING clauses with unresolvable attributes

This commit adds an analyzer rule to
  1. find expressions in `HAVING` clause filters that depend on unresolved attributes, 
  2. push these expressions down to the underlying aggregates, and then
  3. project them away above the filter.

It also enables the `HAVING` queries in the Hive compatibility suite.