[dev.cc] cmd/ld: finalize linkmode before determining whether to import runtime/cgo

Frankly, I don't understand how the current code could possibly work except
when every android program is using cgo. Discovered this while working on
the iOS port.

LGTM=crawshaw, rsc
R=rsc, crawshaw
CC=golang-codereviews
https://codereview.appspot.com/177470043