fix core/main.c wait.h on nonlinux

On FreeBSD there is no wait.h, but sys/wait.h. And I think it is also on other non-Linux platforms (I know about Solaris).