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.