prevent creation of duplicate or retrograde acks: only acks that
advance the ack position are written.
added test for message acking.