cmd/dist: save and restore original permissions in makeGOROOTUnwritable
cmd/dist: save and restore original permissions in makeGOROOTUnwritable

Also log a message and skip the Chmods if running as root.

Updates #30316

Change-Id: Ifb68d06ce845275a72d64c808407e8609df270bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/206757
Run-TryBot: Bryan C. Mills <1c8aad60184261ccede67f5c63a0d2a3bf3c9ff4@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

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