[modules] Factor out ODR checking, to avoid unnecessary repeated work in
finishPendingActions loop.
Silence a warning saying "typedef requires a name" from clang.