syscall: import additional BSD-specific syscall wrappers

Import additional code from upstream for handing system
calls on BSD systems. This makes the syscall package on
NetBSD complete enough to compile the standard library.

Updates golang/go#38538.

Change-Id: I15644dbbd78b1acebcaf45b49403f07c929d97ed
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265123
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Benny Siegert <bsiegert@gmail.com>
2 files changed