Prevent a race condition with MidiHost IPC sending.

EndSession() is moved from MidiHost's destructor into OnChannelClosing() before
the destruction process starts (at which point it is unsafe to call any
functions on the MidiHost/MidiManagerClient).

Also moves a function call on a MidiManagerClient in MidiManager into the AutoLock


Review URL:

Cr-Commit-Position: refs/heads/master@{#369091}
3 files changed