go/types: avoid os.Getwd if not necessary
go/types: avoid os.Getwd if not necessary

Getwd can be very expensive.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/7312100

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