Partial revert of b6d0c40200.  Use stagejob.stack.failed instead of stagejob.failed.

stagejob.stack.failed will be set to True if a previous stage in that stack failed
while stagejob.failed will not be True as it would not even be attempted.