1388e9de8a
This makes the parts where a node is locked more explicit. Also, now the thread is isolated when the node is locked. This prevents some kinds of deadlocks (which haven't happened in practice yet).