internal/impl: fix unmarshal of group containing their own field number

The fast-path unmarshal was getting confused when parsing a group
containing a field with a number the same as the group's own field
number. Separate the handling of EndGroup tags.

Change-Id: I637702b42c94a26102e693ee29a55e80b37d7f28
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/214737
Reviewed-by: Joe Tsai <joetsai@google.com>
diff --git a/internal/testprotos/test/test.proto b/internal/testprotos/test/test.proto
index 644110d..b344573 100644
--- a/internal/testprotos/test/test.proto
+++ b/internal/testprotos/test/test.proto
@@ -44,6 +44,7 @@
   optional group OptionalGroup = 16 {
     optional int32 a = 17;
     optional NestedMessage optional_nested_message = 1000;
+    optional int32 same_field_number = 16;
   }
   optional NestedMessage  optional_nested_message  = 18;
   optional ForeignMessage optional_foreign_message = 19;
@@ -190,6 +191,7 @@
 
   optional group OptionalGroup_extension = 16 {
     optional int32 a = 17;
+    optional int32 same_field_number = 16;
     optional TestAllTypes.NestedMessage optional_nested_message = 1000;
   }