Fix return values check for TerminateThread, ReleaseSemaphore, CloseHandle and ReleaseMutex
Created by: murillo128
According to MDN docs for those functions:
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-releasesemaphore https://docs.microsoft.com/en-us/windows/desktop/api/handleapi/nf-handleapi-closehandle https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-releasemutex https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-terminatethread