The old code relied on the timing of DelayedCalls
to see what had been called or not, but unfortunately
we don't have a real-time OS so the timing on DelayedCalls
can only be approximate. Changed to explicitly keep
track of which calls had been made.
This simplifies the shutdown logic drastically, and I believe
we can take out the reactor.iterate() now
This reverts the change made in 693fef1964
Not sure why this is needed, but taking this out sometimes causes
`exceptions.AttributeError: 'Port' object has no attribute 'socket'`
to happen on shutdown.