[DBAL-834] Fix order by with aggregate function(s) for limit/offset queries on SQL Server

When modifying a query with limit/offset clauses on SQL Server, using aggregate functions, the platform generates wrong SQL.
See http://www.doctrine-project.org/jira/browse/DBAL-834