[qtcontacts-sqlite] Enforce single threaded access to contacts database

Ensure that only one thread is accessing the contacts SQLite database
at any given time.