Per thread sqlite db connections.

This is the simplest solution: don't worry about a connection pool,
instead let the threading machinery handle it all.  The cost is in
memory: if you have many threads, some of which are idle, you are using
much more storage for the DB connections than you need.  Given that we
are holding the entire database in memory, this seems like a reasonable
approach for this particular implementation.

I think this may be close to working.  There aren't any real tests yet,
though, and I'm still not certain about whether or not I need to extend
locking up into the Database transaction layer.