Implement MasterElection

Same question here, why not ```lock_guard```?

But I'm thinking that ```Transition()``` should require the lock, and a nice way to do that would be to take a ```const unique_lock<mutex>&``` (so you can ```CHECK(lock.owns_lock())``` on it).