don't use lazily-evaluated rc.ids in wait_for_idle

iterate through the keys directly,
which should avoid possible KeyError when engine state changes.

should fix occasionally failing tests on Shining Panda
Merge pull request #4568 from minrk/wait-fix-again-keyerror

don't use lazily-evaluated rc.ids in wait_for_idle