Added WaitForPendingUploads

Call to waitForPendingUploads was awkward, so adding an R wrapper