Rewrote PortMIDI thread_main(). (It also used 100% CPU.)