fix pruneEmptyDirectories for modules that are single files, should fix [JENKINS-20317]

this should fix JENKINS-20317