[libcommhistory] Add support for the the contacts-sqlite backend

Tweaks to the Qt5 port to fix compatibility with the qtcontacts-sqlite backend.