Fixed #23877 -- aggregation's subquery missed target col

Aggregation over subquery produced syntactically incorrect queries in
some cases as Django didn't ensure that source expressions of the
aggregation were present in the subquery.
Those suggestions don't work, as we can have multiple expressions which need to be rewritten, and the column index is over all of them. So, the col_cnt is used in the get_aggregation() method to pass the column count between iterations of inner_query.annotation_select.items() loop.

A possibility is to push the whole loop into a submethod. I'm not sure what to call that method.