os/exec: fix race in TestStdinCloseRace
os/exec: fix race in TestStdinCloseRace

The test for the race detector itself had a race of a sort not
detected by the race detector.

Fixes #18286.

Change-Id: I3265eae275aaa2869a6b6d3e8675b0d88b25831b
Reviewed-on: https://go-review.googlesource.com/34287
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

josharian/go,polyverse-security/go,polyverse-security/go,derekmarcotte/go,golang/go,ImJasonH/go,Cofyc/go,josharian/go,nawawi/go,CAFxX/go,nawawi/go,suncycheng/go,codestation/go,CAFxX/go,CAFxX/go,vsekhar/elastic-go,vsekhar/elastic-go,josharian/go,Cofyc/go,cloudflare/go,derekmarcotte/go,linux-on-ibm-z/go,vsekhar/elastic-go,Cofyc/go,Cofyc/go,golang/go,nawawi/go,vsekhar/elastic-go,linux-on-ibm-z/go,vsekhar/elastic-go,cloudflare/go,Cofyc/go,cloudflare/go,codestation/go,golang/go,ImJasonH/go,derekmarcotte/go,golang/go,akutz/go,CAFxX/go,derekmarcotte/go,codestation/go,codestation/go,polyverse-security/go,polyverse-security/go,josharian/go,nawawi/go,golang/go,suncycheng/go,akutz/go,ImJasonH/go,vsekhar/elastic-go,nawawi/go,codestation/go,codestation/go,vsekhar/elastic-go,josharian/go,codestation/go,akutz/go,akutz/go,suncycheng/go,golang/go,golang/go,linux-on-ibm-z/go,nawawi/go,nawawi/go,CAFxX/go,akutz/go,suncycheng/go,codestation/go,Cofyc/go,linux-on-ibm-z/go,cloudflare/go,linux-on-ibm-z/go,derekmarcotte/go,cloudflare/go,josharian/go,akutz/go,derekmarcotte/go,cloudflare/go,vsekhar/elastic-go,ImJasonH/go,josharian/go,Cofyc/go,CAFxX/go,ImJasonH/go,linux-on-ibm-z/go,CAFxX/go,ImJasonH/go,linux-on-ibm-z/go,suncycheng/go,akutz/go,golang/go,christopher-henderson/Go,polyverse-security/go,polyverse-security/go,cloudflare/go,linux-on-ibm-z/go,nawawi/go,ImJasonH/go,cloudflare/go,CAFxX/go,Cofyc/go,derekmarcotte/go,suncycheng/go,suncycheng/go,derekmarcotte/go,polyverse-security/go,suncycheng/go,josharian/go,polyverse-security/go,ImJasonH/go,akutz/go