runtime: impose stack size limit

The goal is to stop only those programs that would keep
going and run the machine out of memory, but before they do that.
1 GB on 64-bit, 250 MB on 32-bit.
That seems implausibly large, and it can be adjusted.

Fixes issue 2556.
Fixes issue 4494.
Fixes issue 5173.

R=khr, r, dvyukov
CC=golang-dev
https://codereview.appspot.com/12541052
misc/emacs: Refactor coverage code into multiple functions

Also fixes color gradient being calculated against the wrong maximum.

R=adonovan
CC=golang-dev
https://codereview.appspot.com/12968043

Committer: Alan Donovan <adonovan@google.com>