runtime,sync: Convert procPin and procUnpin functions to Go.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews, khr
https://codereview.appspot.com/132880043

Committer: Dmitriy Vyukov <dvyukov@google.com>