fix(server.go) remove extra calls of setState
Fix a bug introduced the by race fix. The setState function should not be called if there is no state change.