XWIKI-10217: ORDER BY does not work with XWQL with aggregate functions.

* Fix build by adding a unit test to improve code coverage.