Fix state check in candidate inner loop.

@xiangli-cmu I made the inner loop check for any state change since `server.go:L521` can change the state to `Stopped`. Also, I removed the `break` since it's useless in the select.