Centralize task status management in Task.

#801.  This was a little more than I wanted to bite off in one patch, but it turns out the waitpid W*() macros require an lvalue argument.  Blech.