go/packages: fix race detected by race detector
go/packages: fix race detected by race detector

Diamonds in the dependency graph could cause the same package
to be processed by two separate gorotines, causing a potential
race between checking if the package's Types field is set, and
setting the field.

adonovan's comment suggested this might be unnecessary. We'll
ask him about this once he returns from his vacation.

Change-Id: I27511b6e44bb1b6a04ea294206fd8ed4ea60f56f
Reviewed-on: https://go-review.googlesource.com/127636
Run-TryBot: Michael Matloob <4562438b12c14e81a47550acde616ff328a909f8@golang.org>
Reviewed-by: Ian Cottrell <52376736e5e84615ec49f9c1843b8acc178b1d8d@google.com>
Reviewed-by: Suzy Mueller <a1fd7fee333bfb1457f0c89ab258f70a76be3c5d@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

golang/tools,golang/tools,golang/tools,golang/tools,golang/tools