runtime: refactor CPU profiling Reduce duration of critical section, make pcbuf local to function.
runtime: refactor CPU profiling
Reduce duration of critical section,
make pcbuf local to function.

LGTM=rsc
R=golang-codereviews
CC=golang-codereviews, rsc
https://codereview.appspot.com/102600043

tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go,tv42/old-go