Added threaded SQLite3 class

I tried to make it thread-safe but it seems like a failure.

** Do not merge this pull request. **