[SPARK-2066][SQL] Adds checks for non-aggregate attributes with aggregation

This PR adds a new rule `CheckAggregation` to the analyzer to provide better error message for non-aggregate attributes with aggregation.