#961122: fixes "Missing template users/destroy" error.

 Since user.destroy may fail (if any of the callbacks fail, for example), we need to handle this case as well.
 Fixed similar issues in environment and repositories controllers.