On OSX/linux, made sure the MidiOutput closes its thread on destruction.