Fix build on FreeBSD

pid_t (used at line 216) is available on Linux in `unistd.h` and so on on FreeBSD (`sys/types.h` to be precise, included in `unistd.h`), yet on FreeBSD this header is not automatically included.