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

what would happen if the MIDI mapping array is changed in the UI thread by the user when this function is called by the RT thread?