core: fixes for ack messages.
Added support for pruning the session and page transport-message queues.
Issue #793