[JENKINS-18814,JENKINS-22075] - Handling of deleted tools

The PR adds checks for deleted/renamed tools in several places