cmd/gc: fix race instrumentation of append and type switches.

The remaining issues are about runtime and sync package
instrumentation.

Update issue 4228

R=dvyukov, bradfitz
CC=golang-dev
https://codereview.appspot.com/8041043