Fixed typo in async write and another busy wait case in the event loop