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
is it better that we return index from `maybeAppend` to indicate that how far it confirms that they share the same log entries?