portability: get WIFEXITED and WEXITSTATUS from sys/wait.h

WIFEXITED and WEXITSTATUS are normally declared in sys/wait.h on all
Unices system. Linux has a definition in stdlib.h as well but this is
not portable.

https://bugzilla.gnome.org/show_bug.cgi?id=681328