runtime: handle nil gp in cpuprof
runtime: handle nil gp in cpuprof

This can happen on Windows when recording profile samples for system threads.

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: I5a7ba32b1900a69f3b7acada9cb6cf8396d8a03f
Reviewed-on: https://go-review.googlesource.com/c/go/+/288797
Trust: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>
Reviewed-by: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

CAFxX/go,cloudflare/go,CAFxX/go,CAFxX/go,cloudflare/go,CAFxX/go,nawawi/go,golang/go,nawawi/go,nawawi/go,cloudflare/go,cloudflare/go,cloudflare/go,golang/go,golang/go,CAFxX/go,CAFxX/go,CAFxX/go,golang/go,CAFxX/go,nawawi/go,nawawi/go,nawawi/go,golang/go,cloudflare/go,nawawi/go,cloudflare/go,golang/go,golang/go,nawawi/go,cloudflare/go,golang/go