Fix order when getting data-sets on Postgres

The unit tests fail when USE_SQLITE is not true because the order of the rows returned from the data-set list view is different to those expected. Ordering the results by the primary key fixes this.