gh-73458: Fix logging.config.listen() on a host without an IPv4 address (GH-154491)
The server is created in a thread which set the "ready" event only after a
successful start, so a failure to start left the caller waiting for that
event forever. Set it also on failure.
The receiver always used AF_INET, which fails if the host has no IPv4
address, for example if "localhost" is only aliased to ::1. Use the family
of the first resolved address in such case.
Also fixes gh-82076.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>