TEIID-2564 fix for invalid aggregate planning with a correlated subquery