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