fixes #6289: avoids concurrent downloads of files with the same name and destination dir.

Could the lock file simply be `afile + '.lock'` so it resides in the destination directory?