runtime/debug: make SetGCPercent(-1) wait for concurrent GC
runtime/debug: make SetGCPercent(-1) wait for concurrent GC

Currently, SetGCPercent(-1) disables GC, but doesn't wait for any
currently running concurrent GC to finish, so GC can still be running
when it returns. This is a change in behavior from Go 1.8, probably
defies user expectations, and can break various runtime tests that
depend on SetGCPercent(-1) to disable garbage collection in order to
prevent preemption deadlocks.

Fix this by making SetGCPercent(-1) block until any concurrently
running GC cycle finishes.

Fixes #22443.

Change-Id: I904133a34acf97a7942ef4531ace0647b13930ef
Reviewed-on: https://go-review.googlesource.com/79195
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

akutz/go,nawawi/go,CAFxX/go,cloudflare/go,codestation/go,Cofyc/go,Cofyc/go,codestation/go,akutz/go,golang/go,golang/go,cloudflare/go,josharian/go,codestation/go,nawawi/go,codestation/go,cloudflare/go,CAFxX/go,Cofyc/go,nawawi/go,codestation/go,josharian/go,akutz/go,nawawi/go,golang/go,josharian/go,CAFxX/go,akutz/go,akutz/go,CAFxX/go,cloudflare/go,akutz/go,josharian/go,CAFxX/go,nawawi/go,akutz/go,cloudflare/go,CAFxX/go,golang/go,josharian/go,golang/go,codestation/go,cloudflare/go,akutz/go,Cofyc/go,nawawi/go,cloudflare/go,Cofyc/go,christopher-henderson/Go,codestation/go,golang/go,nawawi/go,josharian/go,golang/go,codestation/go,Cofyc/go,cloudflare/go,golang/go,CAFxX/go,CAFxX/go,josharian/go,Cofyc/go,nawawi/go,josharian/go,Cofyc/go