playWaveFile: Repeatedly call stop until we're certain the previous file playback has been stopped. (#15763)
Fixes #15757.
Summary of the issue:
Asynchronously playing multiple files in quick succession can block while one of the files plays. However, async playback should never block.
Description of user facing changes
NVDA no longer sometimes freezes briefly when multiple sounds are played in rapid succession.
Description of development approach
There are several race conditions where the background thread might feed audio after we call stop in the main thread. Some of these are difficult to fix with locks because they involve switches between Python and blocking native code. We now just keep calling stop until we know that the backgroundd thread is done, which means it was successfully stopped. We know when the background thread is done because it sets fileWavePlayer to None.