cgo: print error instead of panic on undeclared enums/structs
cgo: print error instead of panic on undeclared enums/structs

Types are left as nil if no DWARF information is found and
checking in the rewriting pass so that appropriate errors
with line numbers can be printed.
Fixes issue 2408.

R=rsc
CC=golang-dev, remy
http://codereview.appspot.com/5336041

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang,h8liu/golang