raft: add tests for maybeappend