[qtcontacts-sqlite] Fix automatic local contact generation

When an aggregate contact is modified, a local contact should be
created to store the modifications.  Previously, this was done in an
incorrect manner, and could cause multiple, non-aggregated local
contacts to be generated.

This commit fixes the behaviour so that only a single local contact
is generated, and that it has the required relationship to its
aggregating contact.