Code fixes

Various code fixes, mostly discovered by MSVC code static analyzer .
maybe but none of the error codes of IDirectSoundBuffer::GetStatus is in any way directly related to low memory.