cmd/cgo: replace C.malloc with our own wrapper

This allows us to make two changes:

1. Force the argument type to be size_t, even on broken
   systems that declare malloc to take a ulong.

2. Call runtime.throw if malloc fails.
   (That is, the program crashes; it does not panic.)

Fixes issue 3403.
Fixes issue 5926.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/13413047
net: defend against broken getaddrinfo on Linux

getaddrinfo is supposed to set errno when it returns
EAI_SYSTEM, but sometimes it does not.

Fixes issue 6232.

R=golang-dev, iant
CC=golang-dev
https://codereview.appspot.com/13532045