Move the flagQuery code after the retrieveMissingPayloads() in parseStream() to solve a reproducible lock. Now the fetch command sometimes passes but not reliably.
Move the flagQuery code after the retrieveMissingPayloads() in parseStream() to
solve a reproducible lock. Now the fetch command sometimes passes but not
reliably.

Also moved the call to buildItemQuery() in parseStream to the point where it is
needed first.

svn path=/branches/work/akonadi-sqlite/; revision=1008377

kolab-groupware/akonadi,kolab-groupware/akonadi,kolab-groupware/akonadi,kolab-groupware/akonadi