don't modify list during iteration
don't modify list during iteration

https://sentry.io/dimagi/commcarehq/issues/274133316/

dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq