Use a counter, instead of a loop, to see whether there are more
writebarrier ops in the current block that need to be rewritten.
No visible change in normal compiler speed benchmarks.
Passes toolstash -cmp on std cmd.
Fixes#20416.
Change-Id: Ifbbde23611cd668c35b8a4a3e9a92726bfe19956
Reviewed-on: https://go-review.googlesource.com/60310
Reviewed-by: David Chase <drchase@google.com>