db: add DB.withTx(), which starts a transaction, invokes an input closure, and finalizes the transaction