An Extremum Seeking Algorithm for Message Batching in Total Order Protocols