CoreAudio/MIDI: add locks for port-registration