runtime: fix cgo to handle the case where the G stack is copied.

Tests will come in a separate CL after the funcdata stuff is resolved.

Update issue 8696

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