A failure can have ripple effects that are psychologically far more damaging than the failure itself. Here's how to stop the downward spiral.