Is filename unique enough to use it as a lock name? What happens if someone imports two files named foo.tar.gz at the same time into two courses, which should be allowed I think the courseId might be better or putting this in the course_dir.

Is this really a lock, or just a status file?