refactor(server.go) change setCurrentTerm to updateCurrentTerm

process functions should always compare the term
simplify the logic of updateCurrentTerm
remove unnecessary setState