Persist successful uploads to disk immediately

When uploading a large number of files (and fully expecting this process to die/fail before it finishes uploading all of them), it can be frustrating that the list of successfully uploaded files is stored only in an in-memory shelf object and is persisted only after an attempt to upload every file, in the call to self.uploaded.close().

This diff adds a call to self.uploaded.sync() on every logUpload(), which makes it much faster to fix in tangible form a copy of the fact that a file was uploaded successfully.