fix polyphony limit bug

This bug was caused by race conditions writing to mActiveVoices from
multiple threads. Yet another case for fixing the MIDI threading
architecture!
fix legato portamento handling