xerrors: fix crash in As

Analogous change to CL 168598

Fixes golang/go#30970.

Change-Id: I1810418a9d7cf92a35ca0f4a6d1b2bad560ab671
Reviewed-on: https://go-review.googlesource.com/c/xerrors/+/170960
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2 files changed