os: check return value as well as error from waitid

https://gcc.gnu.org/PR86331 indicates that if a signal handler runs it
is possible for syscall.Syscall6 to return a non-zero errno value even
if no error occurs. That is a problem in general, but this fix will
let us work around the general problem for the specific case of
calling waitid.

Change-Id: I3d9db9ea16b0256eba7f88962909f287db3a7955
Reviewed-on: https://go-review.googlesource.com/121595
Reviewed-by: Than McIntosh <thanm@google.com>
1 file changed