Issue title: duplicate variable-definition in generated code (golang)
 Issue body: It seems that after the merge of PR #518 the variable `i` is defined multiple times (once per map-field) which results in a compiler error.
Here's the line causing the issue: https://github.com/envoyproxy/protoc-gen-validate/pull/518/files#diff-f8225a1531f2fe61141b5466d79ef77ce6910263343191fe1f4c6fdc0ef9035fR41

Here's a sample of the generated code:
```golang
func (m *ErrorCounter) validate(all bool) error {
	sorted_keys := make([]string, len(m.GetCounts()))
	i := 0
	// ...

	sorted_keys := make([]string, len(m.GetComponents()))
	i := 0
        // ...
```

@akonradi can you confirm this issue?
 Comments: 
 Comment 0: Looks like when I added the sorting, I forgot to put the definitions for
those temporaries inside local scopes. The fix should be simple, I'll have
it out in a few hours.

-Alex

On Mon, Sep 27, 2021, 4:51 AM Florian Purchess ***@***.***>
wrote:

> It seems that after the merge of PR #518
> <https://github.com/envoyproxy/protoc-gen-validate/pull/518> the variable
> i is defined multiple times (once per map-field) which results in a
> compiler error.
> Here's the line causing the issue:
> https://github.com/envoyproxy/protoc-gen-validate/pull/518/files#diff-f8225a1531f2fe61141b5466d79ef77ce6910263343191fe1f4c6fdc0ef9035fR41
>
> Here's a sample of the generated code:
>
> func (m *ErrorCounter) validate(all bool) error {
> 	sorted_keys := make([]string, len(m.GetCounts()))
> 	i := 0
> 	// ...
>
> 	sorted_keys := make([]string, len(m.GetComponents()))
> 	i := 0
>         // ...
>
> @akonradi <https://github.com/akonradi> can you confirm this issue?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/envoyproxy/protoc-gen-validate/issues/521>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAWWJKDI3OQYURKRXUDKKI3UEAWALANCNFSM5E2ANLOQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>

 Comment 1: @akonradi thanks for your super quick response!
{'source': 'GithubIssues', 'repo_name_with_owner': 'envoyproxy/protoc-gen-validate', 'issue_id': 1007875029, 'repo_stars': 2204.0}