runtime: simplify heap profile flushing
runtime: simplify heap profile flushing

Currently the heap profile is flushed by *either* gcSweep in STW mode
or by gcMarkTermination in concurrent mode. Simplify this by making
gcMarkTermination always flush the heap profile and by making gcSweep
do one extra flush (instead of two) in STW mode.

Change-Id: I62147afb2a128e1f3d92ef4bb8144c8a345f53c4
Reviewed-on: https://go-review.googlesource.com/37715
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Rick Hudson <838bd060584c511f21c75c69ea04b7b120d86af0@golang.org>

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