Fixes memory leak leading to crashes in Node.js when using MIDI.