Performance fix: Don't set distinct in DataQuery::initialiseQuery()

Currently *all* ORM queries are marked as DISTINCT. This has the effect
of slowing down queries on tables with lots of records dramatically.

Only set distinct if we're setting up a join.