[qtcontacts-sqlite] Mangle detail URIs after aggregate ID is allocated

Aggregate contacts contain mangled versions of the detail URIs in the
details they aggregate, in order to prevent clashes with the same URIs
in constituent contacts.  These URIs should only mangled after the
aggregate ID is allocated, so they can safely contain that ID.
Remove some unnecessary template bloat