Fix loop exit after a concurrency exception