Made cleanupUploadStash use batching for the last two loops

Change-Id: If3cfd333636f5b14c529629ce1ec408d396122a8
Merge "Made cleanupUploadStash use batching for the last two loops"