twfb: Fix SQLite portion of database layer.

db, queries, and fortunes benchmarks are running.