core: Iterate over completed transfers using the correct list node

Commit 006ca0fbaa ("Guard against getting stuck while handling events")
caused a regression using the wrong list node when iterating a list. Fix
this by introducing and using an alternate for_each iterator.

Closes #796

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
3 files changed