go/types: fixed a few failure checks

More robustness in case of incorrect programs.

Fixes issue 4962.

R=dsymonds
CC=golang-dev
https://codereview.appspot.com/7429047