Handle exceptions other than ValidationFailed (bnc#900029)

This fixes a crash on undefined method first for nil:NilClass
in the ensure clause.
Merge pull request #1144 from dirkmueller/master

Handle exceptions other than ValidationFailed (bnc#900029)