fix and future-proof against stack overflow in aio io threads