add generalized localTx method in DB and DBConnection

we want to rollback when the execution returns a Failure of Try in `localTx`
Although it's a matter of taste, I prefer finishTx. Please consider renaming.