Fix cgroup's MacOS-specific linter failures
In !5547 (merged), we added the support for CgroupV2. It also introduced some linting offenses on MacOS. They are mostly about unused functions or types. On Linux, everything is fine. But on MacOS, files with specific build tags are not included.