third_party: update chromite's vendored protbuf 3.13 --> 4.21.9

The current copy is from 2020-08 and needs updating so that protos
can remain idiomatic (e.g., use of the "optional" keyword). Advancing
takes advantage of other optimizations.

4.21.9 matches the current version available in the SDK, and supports
the "optional" keyword as well as generation of type annotations.

To use it, compile_build_api_proto.py is updated to pull protoc from a
new CIPD prefix at infra/3pp/tools/protoc, which is regularly updated.

The "fork" is patched to use chromite import paths, with the only
other change a tweak to internal/api_implementation.py to ensure it
does not look for compiled implementations from system site packages.

Patchset 1: https://github.com/protocolbuffers/protobuf/tree/v21.9/python/google/protobuf
Patchset 2: sed -i -re 's/( *)from google\.protobuf/\1from chromite.third_party.google.protobuf/'
Patchset 3: point compile_build_api_proto to 4.21.9 at new CIPD prefix + regenerate
Patchset 6: fix errors picked up in ./run_tests (version check, api_implementation)
Onwards: Rebasing (regenerate at @5b48513b1), CL description updates

BUG=b:293226674
TEST=CQ

Change-Id: If557e07962eee3f75d113c49b065fe9fb9cef9bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4718152
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Tested-by: Trent Apted <tapted@chromium.org>
diff --git a/api/compile_build_api_proto.py b/api/compile_build_api_proto.py
index 485ded9..67614b3 100644
--- a/api/compile_build_api_proto.py
+++ b/api/compile_build_api_proto.py
@@ -22,10 +22,14 @@
 
 
 # Chromite's protobuf library version (third_party/google/protobuf).
-PROTOC_VERSION = "3.13.0"
+PROTOC_VERSION = "21.9"
 
-_CIPD_PACKAGE = "infra/tools/protoc/linux-amd64"
-_CIPD_PACKAGE_VERSION = f"protobuf_version:v{PROTOC_VERSION}"
+# Protobuf dropped the major version number after 3.20, jumping to 21.0. But
+# some places (e.g., in protobuf/__init__.py) refer to this as 4.21.0.
+PROTOC_MAJOR_VERSION = "4"
+
+_CIPD_PACKAGE = "infra/3pp/tools/protoc/linux-amd64"
+_CIPD_PACKAGE_VERSION = f"version:2@{PROTOC_VERSION}"
 
 
 class Error(Exception):
@@ -66,7 +70,7 @@
         if self is ProtocVersion.SDK:
             return Path("protoc")
         elif cipd_root:
-            return cipd_root / "protoc"
+            return cipd_root / "bin" / "protoc"
 
 
 @enum.unique