I think it would make sense to set the pid once in `cpu/native/startup.c` and merely use it here. This would be the third place where it is obtained. I'll open a PR shortly.