This is not right. Only a maximum number of unveil's are allowed, before it starts returning E2BIG. That amount is not a public #define, to discourage what you are doing.
You are trying to shove an unbounded number of them into the kernel, based upon getenv and argv. When you run out, and will exit with error. That's not very nice is it?