test/run: handle compiledir and errorcheckdir with multi-file packages

Multiple files with the same package all get compiled together.

R=golang-dev, iant, dave
CC=golang-dev
https://codereview.appspot.com/7005053
cmd/gc: make redeclaration between import and func less confusing

Fixes issue 4510.

R=ken2
CC=golang-dev
https://codereview.appspot.com/7001054