raft: Make MsgAppRes ack only the last index in MsgApp

As explained in #1366, the leader will fail to transmit the missed
logs if the leader receives a hearbeat response from a follower
that is not yet matched in the leader. In other words, there are
append responses that do not explicitly reject an append but
implied a gap.

This commit is based on @xiangli-cmu's idea. We should only acknowledge
upto the index of logs in the append message. This way responses to
heartbeats would never interfer with the log synchronization because
their log index is always 0.

Fixes #1366
raft: change raftLog.maybeAppend to return the last new index

As per @unihorn's comment on #1366, we change raftLog.maybeAppend to
return the last new index of entries in maybeAppend.
raft: add tests for ignoring heartbeat reply
Merge pull request #1387 from xiangli-cmu/fix_raft

Fix raft