[performance] in queryContacts, only load wanted details (Contributes JB#22052)

This commit adds a check on the detail type to the query in queryContacts.
It means doing an extra string comparison in sqlite, but that's faster
than processing extra rows in QSqlResult.

The check is not done if the detailTypes hint is empty, because
in that case (nearly) all the rows will be loaded anyway.