Corrected a bug related to hashes persistence (to cache file):

 - previously we only kept the list of hashes that were successful in
   the current run but that completely ignored the hashes successful
   from past runs (old hashes). Changed that so that...
 - now we record instead files that are rejected (failed to upload)
   and from the "current" list (which includes all hashes: old + items
   from this run) we only exclude the ones that failed;
 - made completedList more generic (as it is really just a list with a
   mutex) and moved it to its own file.