Fix race condition in test case.
Fix race condition in test case.

Brought over from master repository.

R=iant
CC=gofrontend-dev
https://golang.org/cl/3982048

anlhord/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,golang/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,golang/gofrontend,golang/gofrontend