[67] Prevent addToArchive task from terminating before all its suboperations have completed.

* Fixed function isArchived to fetch actual files' on-disk status
instead of just checking for hash presence in DB.
* Minor coding style corrections.