runtime/race: add end-to-end test
Fixes issue 5933.

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