[PATCH 5.4 145/147] libbpf: Extract and generalize CPU mask parsing logic