Fix race condition when stopping audio stream on Windows. 1. We were stopping wave out playback first (waveOutReset()) and only then stopped    callbacks, so callback could buffer more data after playback stopped,    causing waveOutClose() to fail because not all buffers were freed.    Fix is to stop callbacks before stopping playback. 2. We also have to manually reset buffer event before starting playback, because    it can be left in the signalled state when we previously were stopping the stream. 3. Do not delete the stream if stop/close failed, because we can still have active    callbacks that would access freed object. Better to leak the memory.
Fix race condition when stopping audio stream on Windows.
1. We were stopping wave out playback first (waveOutReset()) and only then stopped
   callbacks, so callback could buffer more data after playback stopped,
   causing waveOutClose() to fail because not all buffers were freed.
   Fix is to stop callbacks before stopping playback.
2. We also have to manually reset buffer event before starting playback, because
   it can be left in the signalled state when we previously were stopping the stream.
3. Do not delete the stream if stop/close failed, because we can still have active
   callbacks that would access freed object. Better to leak the memory.

BUG=109757,108685

TEST=Crashes in PCMWaveOutAudioOutputStream::Close() should go away.

Review URL: http://codereview.chromium.org/9148077

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@117735 0039d316-1c4b-4281-b951-d872f2087c98

gavinp/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium