si_code in siginfo_t is a macro on NetBSD, not a member of the
struct itself, so add a C trampoline for receiving its value.
Also replace references to mos.waitsemacount with the replacement and
add some helpers from os_netbsd.go in the GC repository.
Update golang/go#38538.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/228918