Fixes golang/go#8192. LGTM=bradfitz R=bradfitz, adonovan CC=golang-codereviews https://golang.org/cl/105160043