[qtcontacts-sqlite] Improve detail aggregation semantics

Detail promotion now includes access constraint propagation, and
also correctly handles detail removes/modifies as well as creations.
Unit tests have been improved to ensure we don't regress.