fix #28336: Sending 'program change' message to JACK MIDI Out

I'm not concert while emitting. I'm concerned by the fact we are iterating (foreach) an array in the RT thread that could change in the UI thread (like all elements deleted). That would be a problem no?