raft: stableTo checks term matching

stableTo should only mark the index stable if the term is matched. After raft sends out unstable
entries to application, raft makes progress without waiting for reply. When the appliaction
calls the stableTo to notify the entries up to "index" are stable, raft might have truncated
some entries before "index" due to leader lost. raft must verify the (index,term) of stableTo,
before marking the entries as stable.
raft: add tests for stableTo
Merge pull request #1809 from xiang90/unstable

raft: stableTo checks term matching