cmd/cgo: retain Go pointer passed to C call for duration of call

Fixes issue 6397.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://codereview.appspot.com/13858043
sync/atomic: adjust for new runtime.cas64 prototype

R=golang-dev, minux.ma, josharian
CC=golang-dev
https://codereview.appspot.com/13859043