Fix ordering on an aggregate in MSSQL

Ensure that an order clause which contains aggregate functions does not get manipulated.
This should fix jruby/activerecord-jdbc-adapter#532