'changed' key is not defined when task fails

fix KeyError introduced by fix of #6591.
Merge pull request #6658 from pilou-/fix_fix

'changed' key is not defined when task fails