**Describe the bug** ALSA sequencer device leaks when toggling MIDI ON/OFF **To Reproduce** 1. Build musescore with ALSA MIDI support enabled. 2. Click on the MIDI DIN-5 plug ICON four times. 3. Run "aconnect -l" 4. Verify that multiple ALSA MIDI instances are registered. **Expected behavior** At any time only one instance should be registered. **Screenshots** Not applicable. **Platform information** - OS: FreeBSD (MuseScore 3.6.1) **Additional context** Patches are attached: 1. [patch-audio_drivers_alsa.cpp.txt](https://github.com/musescore/MuseScore/files/7964105/patch-audio_drivers_alsa.cpp.txt) 2. [patch-audio_drivers_mididriver.cpp.txt](https://github.com/musescore/MuseScore/files/7964106/patch-audio_drivers_mididriver.cpp.txt) 3. [patch-audio_drivers_alsamidi.h.txt](https://github.com/musescore/MuseScore/files/7964880/patch-audio_drivers_alsamidi.h.txt)