Patch for SDL_mixer: native_midi_win32 module race condition with MCI subsystem

As part of my campaign to clean up multithreaded execution problems related to SDL audio and SDL_mixer in particular, I have developed a patch to a problem in the Win32 native midi module - the code as is (in both 1.2 and 1.3 branches) does not wait for the MCI subsystem, which executes the provided callback routine on a separate thread, to indicate that it has finished with the buffer before closing and freeing the midi stream.

The patched code can be found here:
http://eternity.mancubus.net/text/native_midi_win32_fix.c

And a summary of the changes made here (note this is not a standard format diff and I apologize for that; I do not happen to have that tool on my system):
http://eternity.mancubus.net/text/diff.txt

There is also a small chance that some additional system headers could be required to compile with the changes. I assume that these should be easy to find and fix for whomever maintains this library._________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/