Fix waitpid on dfly and old freebsd versions