fix SQLiteEngine.table_exists
setup thread safe db committing.