[FIX] http dispatch: make sure transaction rollback happens in all cases when request handling raised (to be refactored)

Not doing so leads to cases where a transaction is committed
even after failing to validate a Python constraint.
This patch attempts to keep the rollback() logic next to the
corresponding commit(), and makes the rollback() more
explicit even if close() without commit() would also rollback
implicitly.