fix(scheduler): avoid stack overflow when flushing very large post cb arrays (#15143)