Made the new --prune-empty-dirs code a little more memory efficient.