[qtcontacts-sqlite] Use a semaphore for process mutex on writes

Although SQLite supports multiple concurrent processes, the behaviour
on write contention is undesirable, resulting in starvation.

Use a semaphore to provide mutual exclusion between writing processes
so that only one has write access to the database at any given time.