JournalDB: Do prepare the queries even if the db update failed.

Also, add more logging in case SQL errors happen while db structure
update.