Fixed sqlite3 related to multiple threads.