[FIXED JENKINS-19574] Restore backward compatibility in prebuild cleanup