runtime: set up g early

runtime.throw needs a g to work properly. Set up g early, to
ensure that if something goes wrong in the runtime startup (e.g.
runtime.check fails), the program terminates in a reasonable way.

Change-Id: I8678ef29383f066915672dfb8632eda305e49ae4
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
4 files changed