Use reference counting to manage Connection object lifetimes. This implements an old idea from #176 (comment) and has two benefits:
- Makes it possible to wait for objects associated with a Connection to be freed, to support unclean shutdowns better. This was implemented in base PR #335 for server objects, and this PR extends it to treat client and server objects symmetrically.
- Allows dropping the cleanup handlers
ProxyClientobjects register with Connections, soConnectionobjects no longer need to store lists ofProxyClientobjects and can just use use counts instead.
<!-- begin based-on -->
This is based on #335 + #365. The non-base commits are:
c43ba53proxy-io: manage Connection lifetime with shared_ptra4044a6proxy-io: keep client capability handles across disconnect14f44bddoc: scope Connection cleanup callbacks to per-thread map entries75381d5proxy-io: make server object tracker a plain Connection membercae9d62ci: Check out bitcoin/bitcoin PR [#35932](/bitcoin-core/libmultiprocess/35932/) instead of master<!-- end -->