Fix the completion (or abort) of the download thread