Check the return value of calls to `GetBuffer` and stop the `WASAPI
handler` sound thread if they fail.
This prevents a crash due to a null pointer dereference if `GetBuffer`
is unable to retrieve a buffer, which could be triggered during
emulation by disabling the selected WASAPI output device in the Windows
Sound settings.