Using `with threading.Lock():` directly has no effect.
Correct usage is:
```
lock = threading.Lock()
with lock:
...
```
This applies for:
* threading.Lock
* threading.RLock
* threading.Condition
* threading.Semaphore
* threading.BoundedSemaphore
Signed-off-by: Martin Basti <mbasti@redhat.com>