xerrors: check for nil pointers in As's target

As already checks for a nil or non-pointer target; check for nil pointers
as well. Produces a better error message and catches incorrect target
parameters even when the target doesn't match the error.

Change-Id: I06efb4b78f640b17076f002519d275b328b42557
Reviewed-on: https://go-review.googlesource.com/c/161657
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2 files changed