[qtcontacts-sqlite] Properly enforce uniqueness constraints

Uniqueness constraints on details were previously not enforced
correctly.  This commit adds uniqueness constraint checks, and adds
a unit test to ensure we don't regress.

Also improve the aggregation unit tests to ensure that only one local
contact is ever created for new aggregate contact details.