[services] Clean up proto_codegen.sh using ShellCheck
Summary: Related Linear issue here. This is part of a set of diffs that will allow ShellCheck to be added to the CI. See inline comments for specific details of the ShellCheck error/warning output.
Test Plan:
ShellCheck
Additionally, this script is run by build_service.sh, which is run during the Backup, Blob, and Tunnelbroker builds so if those workflows continue to pass CI we can reasonably assume that the script continues to work as expected.
Reviewers: atul, jon, tomek, ashoat
Reviewed By: jon
Subscribers: adrian, karol
Differential Revision: https://phab.comm.dev/D4721