Update the code for the latest version of asyncio.

Make the runserver monkey-patch more robust.