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
scope.

BUG=576383
R=toyoshim@chromium.org,agoode@chromium.org

Review URL: https://codereview.chromium.org/1576323002

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