Fixed async_write memory leak. Auto exit eventloop.