move waitpid, waitid to common code, special Linux version that supports rusage