Use an atomic lock-backed election for primary-instance startup,
distinguish live peers from stale endpoints, and bound handoff retries.
Keep the application usable when a desktop has no system tray and cover
first-launch races, stale recovery, and visible-window behavior.
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
Create and dispose the DNS resolver with its owning connection manager
instead of at module import time. Make cleanup explicit and keep
architecture and external-core tests aligned with injected resolver
ownership.
Signed-off-by: Loren Eteval <loren.eteval@proton.me>