Previously, this was returning the status value from waitpid directly.
That is incorrect as the actual exit status from the executed program
is likely to be in high-order bits of that status value. Instead, use
the WEXITSTATUS macro to return the actual exit status value.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>