[qtcontacts-sqlite] Avoid potential deadlock

Avoid deadlock that could occur by having two processes try to acquire
the two semaphores in reverse order.
Merge pull request #161 from matthewvogt/lock-order

[qtcontacts-sqlite] Avoid potential deadlock