raft: fix transmission logic

As explained in #1366, the leader fails to transmit the missed
logs if it receives a hearbeat response from a follower that is
not yet matched in the leader. When a follower is not matched,
there are append responses that do not explicitly reject but
imply 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.

All test cases pass.

Fixes #1366
sounds good to me. I modified the commit. PTAL.