Corrects a misunderstanding in fd2079b89fed3ed8cf62e96951ee3f96af1a8acb
which fixes a bug reported by Austin Walker.
Fixed some bad permissions.
Fixed more bad permissions.
Work around waitid bug WNOWAIT pre 2.6.22.