midiinput: more robust unloading
Merge pull request #505 from mamoch/master

midiinput: more robust unloading