logsource: log_msg_ack() refactored

the following two function calls forms finalize_ack:
  - ack rate is adjusted by ack_rate_adjust()
  - window_size is grown by log_source_window_size_grow()

log_msg_ack() calls finalize ack, unref LogMessage and its parent pipe

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
proto: WIP :bookmark added

late ack mechanism:
 - late ack is for position tracking
 - position should be saved only after the LogMessage (corresponding to the
   logline read from the position we want to save) has ACKed

in order to do that:
- proto queued() method removed [before the late-ack era queued() has called
  after the LogMessage forwarded to the LogWriter::queue and this method saved
  the position immediately -> this means that if the message ACK has aborted we
  lost that message]

- fetch() knows the position of the stream where logline read, we just set a
  bookmark for that position

- if the fetched data is a valid log message, a new LogMessage object is
created and the bookmark is bound to that object

- when a positive ACK is received for the LogMessage, bookmark is saved

Decoupling position save from queued() generates a new problem: it is not
guaranteed that the ACKs received in-order (eg.:
  msg1 -> unmatching filter -> the message is processed -> ACKed
  msg0 -> destination -> logqueue -> transport -> ACKed
).

For solving this problem we have to use a Ringbuffer storing AckRecords.
AckRecord = (Bookmark, ack status).
(Number of slots in Ringbuffer is proportional to window size; when window is
full, no new message is received, thus no new Bookmark is needed)

For every incoming message an AckRecord is bound when it is queued to
logsource(log_source_queue() called, this is the point when we know that
the fetched line is a valid logmessage, Bookmark is filled, it is ready for
forwarding to the consumer's queue).

When a continuous range of positive ACK is formed at the head of
the RingBuffer, Bookmark of the AckRecord with the highest position in the
range is saved and the range is dropped from the RingBuffer
(-> the ringbuffer head is reset by range length, window size also increased
by range-length).

Tracking ACKs: AckTracker

Using AckTracker for reliable cases is OK but what about "unreliable" cases
where no position tracking supported? There are two kind of AckTrackers:
a reliable and a non-reliable. Non-reliable AckTracker just not use a
RingBuffer, not saving a Bookmark, of course, and window size increased by 1.

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
ack_tracker: WIP: added

it's not working, but compile...
it should be squashed into the other WIP patch

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>