[JENKINS-22811] Folder loading can break when an item inside the folder fails to load or throws an Exception. (cherry picked from commit 3e29bd7e)