The returned errors from syscall.Syscall* and windows.LazyProc.Call come
from GetLastError. The value of GetLastError is not reliable when the
function succeeds.
This change fixes the usages of error values. The error value is now
used only when the API explicitly fails.