Fix: calling 'each_with_index' block with two parameters

This fixed a problem that caused ffi-coremidi to crash on my system. (Trying to call 'populate_endpoint_ids', but the entity is an array, not a Device)