Write to a koa response in generator style