Fix localElector locking issues
This commit cleans up some code and reduces the locking time needed to
lock the list of nodes. We now lock access on specific updates to the
nodeCandidate
statuses but avoid locks on the entire nodeCandidate
list.
Closes #2632 (closed)
Edited by GitLab Release Tools Bot