Ensure that the task artifact cache is always locked prior to performing up-to-date checks:
- this was not the case when a task was directly executed in a build script.