[scripts] make install_protobuf script work on macos
Summary: nproc isn't a command on macos, so we need to use sysctl if it's not available
Test Plan: CI passes
Reviewers: jon
Reviewed By: jon
Subscribers: ashoat, tomek, atul
Differential Revision: https://phab.comm.dev/D6525