Add SyncJournalDB autotests.

There also was a bug in syncjournaldb: in some error conditions the
sql query wasn't reset properly. We now always reset a query before
calling bindValue.