daemon: Change error checking in SQLiteDatabase