Fix lock_many race condition

Here is the output of the new test in ```paddles/tests/controllers/test_nodes_race.py``` with ```rollback()```

And here is the output of the same test without ```rollback()```
https://gist.github.com/zmc/beb1ecf31a8c3bed16a5

https://gist.github.com/zmc/978b3df9d12e29c51c20