Fixed waitpid call so it waits for any child