runtime: fix _cgo_allocate(0)

Fixes a SWIG bug reported off-list.

LGTM=iant
R=iant
CC=golang-codereviews
https://codereview.appspot.com/155990043