Redmine/6553: Fix implicit looping over multiple lists

Pull request for initial review of the changes to the code. Planning to add more test coverage to the acceptance test before merging.
Very confusing layout - I almost didn't notice the `do` - and I don't believe it conforms to our coding style.
```
if (!NullIterator(iter_ctx))
{
    do
    {
        .... /* I hope nothing here uses continue ! */
        ++i;
    } while (PromiseIteratorNext(iter_ctx));
}