Fix UoW thread local not being unset if Connection.close fails.
Close connections if the UnitOfWork can't be constructed.