[JENKINS-21579] Copied as-is from Ant 1.8.3 to apply patches

(cherry picked from commit 69773dc9f785b12f033ba268fb4e4107fc3e7f46)
[FIXED JENKINS-21579] UberClassLoader.findResources() improvements

This is just a locally patched version, so not meant to be used outside
core.

Cherry-picked-from: 9a2882dd704bece9b7ca51a52347dad15d79f843