fix uaa traces being cut off
upload: don't send a .zip if all resources matched

prune empty directories after removing matched resources,
so that no .zip is created

[finishes #44037069]