Help with the locks

For context why that worked, loops introduce their own scope for each iteration.

https://docs.julialang.org/en/v1/manual/variables-and-scoping/