Fixing an async iteration bug in `array.each()`