tweak onAppendEntriesResponse logic

1. make sure check role after handling term value
2. change leader_id in proto to int32