testing: only call flag.Parse if it has not been called before
testing: only call flag.Parse if it has not been called before

Calling flag.Parse twice can be problematic if other goroutines called
flag.Parsed in between: the race detector complains due to the
write after read from a different goroutine.

This can happen if TestMain calls flag.Parse and launches goroutines
that call flag.Parsed, for example if it initializes a server which
checks flags.

This patch makes testing.M.Run only parse the flags if they have not
been parsed already.

Change-Id: Id9f8c31c5f90614e3f34c63d1a32cf7e9055d68e
Reviewed-on: https://go-review.googlesource.com/16739
Reviewed-by: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

codestation/go,ImJasonH/go,binarycrusader/go,ganboing/go-esx,binarycrusader/go,cloudflare/go,vanloswang/go,Jordanzuo/go,rachtsingh/gogojuice,CAFxX/go,cyberroadie/go,linux-on-ibm-z/go,golang/go,vanloswang/go,Samurais/go,cloudflare/go,codestation/go,linux-on-ibm-z/go,josharian/go,goodlang/good,4ad/go,nawawi/go,miolini/go,rachtsingh/gogojuice,nawawi/go,cyberroadie/go,suncycheng/go,Endika/go,Samurais/go,theif519/go,rachtsingh/gogojuice,Jordanzuo/go,kim-racktop/go,Endika/go,nawawi/go,momchil-velikov/go,cyberroadie/go,Samurais/go,theif519/go,ganboing/go-esx,ImJasonH/go,codestation/go,sndnvaps/go,kim-racktop/go,ganboing/go-esx,goodlang/good,momchil-velikov/go,akutz/go,linux-on-ibm-z/go,vsekhar/elastic-go,Samurais/go,linux-on-ibm-z/go,ganboing/go-esx,vsekhar/elastic-go,mwhudson/go,derekmarcotte/go,akutz/go,golang/go,Endika/go,polyverse-security/go,goodlang/good,cloudflare/go,kim-racktop/go,suncycheng/go,akutz/go,binarycrusader/go,deft-code/go,rachtsingh/gogojuice,fjballest/golang,golang/go,momchil-velikov/go,codestation/go,fjballest/golang,Samurais/go,mwhudson/go,linux-on-ibm-z/go,Cofyc/go,goodlang/good,mwhudson/go,rachtsingh/gogojuice,4ad/go,binarycrusader/go,momchil-velikov/go,polyverse-security/go,CAFxX/go,ImJasonH/go,fjballest/golang,golang/go,4ad/go,polyverse-security/go,nawawi/go,4ad/go,vanloswang/go,sndnvaps/go,josharian/go,Samurais/go,Cofyc/go,Cofyc/go,golang/go,ImJasonH/go,vanloswang/go,sndnvaps/go,codestation/go,theif519/go,deft-code/go,Jordanzuo/go,kim-racktop/go,mwhudson/go,roth1002/go,cloudflare/go,mwhudson/go,suncycheng/go,vanloswang/go,linux-on-ibm-z/go,josharian/go,sndnvaps/go,Endika/go,miolini/go,Samurais/go,CAFxX/go,goodlang/good,miolini/go,Cofyc/go,sndnvaps/go,goodlang/good,CAFxX/go,sndnvaps/go,josharian/go,binarycrusader/go,roth1002/go,CAFxX/go,vsekhar/elastic-go,nawawi/go,miolini/go,suncycheng/go,ImJasonH/go,josharian/go,Endika/go,derekmarcotte/go,vanloswang/go,Jordanzuo/go,fjballest/golang,rachtsingh/gogojuice,kim-racktop/go,suncycheng/go,vsekhar/elastic-go,goodlang/good,golang/go,Jordanzuo/go,ganboing/go-esx,roth1002/go,miolini/go,ImJasonH/go,4ad/go,deft-code/go,theif519/go,polyverse-security/go,akutz/go,Jordanzuo/go,Endika/go,momchil-velikov/go,miolini/go,cloudflare/go,derekmarcotte/go,derekmarcotte/go,Cofyc/go,Endika/go,christopher-henderson/Go,theif519/go,akutz/go,kim-racktop/go,odeke-em/go,binarycrusader/go,josharian/go,deft-code/go,cloudflare/go,kim-racktop/go,odeke-em/go,fjballest/golang,deft-code/go,cyberroadie/go,rachtsingh/gogojuice,Endika/go,codestation/go,Jordanzuo/go,cyberroadie/go,deft-code/go,ganboing/go-esx,goodlang/good,linux-on-ibm-z/go,binarycrusader/go,Jordanzuo/go,momchil-velikov/go,roth1002/go,sndnvaps/go,cloudflare/go,suncycheng/go,odeke-em/go,Cofyc/go,akutz/go,sndnvaps/go,vanloswang/go,odeke-em/go,polyverse-security/go,vsekhar/elastic-go,polyverse-security/go,cyberroadie/go,cyberroadie/go,CAFxX/go,polyverse-security/go,polyverse-security/go,odeke-em/go,odeke-em/go,momchil-velikov/go,nawawi/go,nawawi/go,ganboing/go-esx,derekmarcotte/go,derekmarcotte/go,4ad/go,suncycheng/go,akutz/go,roth1002/go,momchil-velikov/go,miolini/go,josharian/go,golang/go,4ad/go,theif519/go,cloudflare/go,ImJasonH/go,roth1002/go,theif519/go,codestation/go,mwhudson/go,roth1002/go,golang/go,akutz/go,CAFxX/go,rachtsingh/gogojuice,vsekhar/elastic-go,derekmarcotte/go,Cofyc/go,odeke-em/go,vsekhar/elastic-go,theif519/go,CAFxX/go,nawawi/go,odeke-em/go,suncycheng/go,fjballest/golang,miolini/go,mwhudson/go,derekmarcotte/go,fjballest/golang,vsekhar/elastic-go,codestation/go,roth1002/go,Cofyc/go,deft-code/go,josharian/go,cyberroadie/go,mwhudson/go,4ad/go,linux-on-ibm-z/go,binarycrusader/go,ganboing/go-esx,deft-code/go,kim-racktop/go,fjballest/golang,vanloswang/go,ImJasonH/go,Samurais/go