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

sanjosh/sanjos100-tipc,d0f/go-zh,sanjosh/sanjos100-tipc,bryanxu/go-zh,d0f/go-zh,d0f/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,sanjosh/sanjos100-tipc,d0f/go-zh,bryanxu/go-zh,d0f/go-zh,sanjosh/sanjos100-tipc,bryanxu/go-zh,d0f/go-zh,webfd/go-zh,webfd/go-zh,webfd/go-zh,webfd/go-zh,webfd/go-zh,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,d0f/go-zh,bryanxu/go-zh,bryanxu/go-zh,bryanxu/go-zh,bryanxu/go-zh,d0f/go-zh,webfd/go-zh,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc