Store last sent term in the appendEntries request so that it can be used
while processing the response.
Use the last entry being appended to update prev_log_term and last_sent_entry
instead of the next entry about to be appended.