[qtcontacts-sqlite] Do not dereference null table pointer

If we cannot access the table, the end iterator should be the same
as the begin iterator.

Also increase the time we wait to acquire a table lock, to account
for high-load periods such as during startup.
Merge pull request #158 from matthewvogt/null-deref

[qtcontacts-sqlite] Do not dereference null table pointer