fix connection leak: close tx in case of exceptions as well