TS-3038: Fix delete of loop iterator.