DataQuery::count() doesn't use SQLQuery::setDistinct() API

Remove hardcoded "DISTINCT" in SQL and use `setDistinct(true)` on SQLQuery instead which does the same thing, but using the API correctly.