Hopefully fix two bugs:
 - Loop was not writing the last successful file upload time, so would
   repeatedly upload the same file.
 - If a file was not finished being created, upload would panic. Used a
   heuristic by looking for a stable file size which will hopefully identify a
   file still being created.