Add cache-based locking to subtasks to ensure that the same task is not ...

...running in two workers at the same time.

Cherry-pick of https://github.com/edx/edx-platform/pull/1438.