bpo-39651: Fix asyncio proactor _write_to_self() (GH-22197)


Fix a race condition in the call_soon_threadsafe() method of
asyncio.ProactorEventLoop: do nothing if the self-pipe socket has
been closed.
(cherry picked from commit 1b0f0e3d7d03155da1cf9769a847874d559e57e3)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 files changed