[JENKINS-44942] - FilePath.list() & .listDirectories() null safety (cherry picked from commit a5dc255d)