Tested on pi. Fixed midi_close()