runtime: correct semaphore implementation on netbsd

NetBSD's semaphores use the underlying lighweight process mechanism
(LWP) on NetBSD, rather than pthreads. This means the m.prodcid needs
to be set to the LWP ID rather than the pthread ID in order for unpark
notifications to get sent to the right place.

Introduce a new getProcID() method that selects the correct ID for the
platform.

Change-Id: I897406e5a9d5bb9025088680ee9f89b9a6c8ff11
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261742
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Trust: Than McIntosh <thanm@google.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
6 files changed