[qtcontacts-sqlite] Include transient state when filtering or sorting on presence

When a contacts query requires that we filter on IsOnline status, or
sort by global presence state, include the data from the transient
detail store so the query can be performed correctly.

Note, there will be many cases where this is not enough; if we identify
further important use-cases that also require access to the transient
data we will need to add special case handling for those also.
Filter out transient details that are not in the defintion mask
Update IsOnline status flag from transient details

If the transient details contain the global presence, then the value
in the contacts table's isOnline field is out of date; prefer the
value from the transient data.
Merge pull request #155 from matthewvogt/online-sort

[qtcontacts-sqlite] Include transient state when filtering or sorting on presence