raft: fix node bench
raft: make unstable.entries immutable; copy the entries at bad path
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
*: support purging old wal/snap files
Merge pull request #1810 from xiang90/purge

*: support purging old wal/snap files
Merge pull request #1806 from xiang90/no_copy

No copy
integration: use timeout transport when launching cluster

This makes it do the same behavior as etcdmain does.
raft: fix memory storage

Memory storage should append all entries that have greater index
than the snap.Matedata.Index. We first truncate the old parts of
incoming entries. Then truncate the existing entries in the storage.
At last, we append the incoming entries to the existing entries.
Merge pull request #1820 from xiang90/fix_storage

raft: fix memory storage
Merge pull request #1819 from yichengq/239

integration: use timeout transport when launching cluster
etcdserver: close idle connections when stop sendhub
wal: not return ErrIndexNotFound in ReadAll

This IndexNotFound case is reasonable now because we don't write dummy
entries into wals any more.
doc: uses spaces consistently in sample JSON

Replaces spurious uses of tabs with four spaces.  Removes strange
unicode space character with standard space character.
Merge pull request #1827 from lamielle/doc-whitespaces

doc: uses spaces consistently in sample JSON
raft: logging state change events and events on bad path
Merge pull request #1823 from xiang90/raft_log

raft: logging state change events and events on bad path
Merge pull request #1824 from yichengq/241

etcdserver: close idle connections when stop sendhub
raft: use index in entry