Fixed bug in midiInM and midiOutM

There was a delay bug in midiInM and midiOutM that this commit should
fix.