Ensure mounted transports are closed even if main transport raises

MB
3mo ago
+110-16

If a client with proxy mounts fails to close the main transport (its close()/exit/aclose()/aexit raises), the mounted transports were never reached, leaking their connections. Wrap the main transport cleanup in try/finally so mounts are always closed regardless.

Ported from encode/httpx#3769.