twfb: Make database and statement opaque structures

Not only good for API consistency, but also provides some insurance that the
first parameter being passed to each function pointer is the same (or at the
very least, the same db_* type, so that they point to the same functions).