runtime, runtime/debug, runtime/race: deflake tests

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

Committer: Brad Fitzpatrick <bradfitz@golang.org>