WL#10493: Add transaction length to gtid_log_event

Affects: Server-8.0   —   Status: Complete

Add transaction length to the Gtid_log_event in the binary log.

This is a stepping stone for:

 1. Optimizing the applier. Currently, the coordinator thread dispatches one
    event at a time to the workers. This context switch is expensive, and
    becomes more of a bottleneck the more we optimize other things. If we have
    the transaction length, we can dispatch the whole transaction in just one
    context switch. Since RBR transactions use at least 5 events
    (gtid+begin+table_map+row+commit) this is a big improvement.
 2. Optimizing the protocol. Currently, we send each event in one packet. If
    we have the length easily available, it becomes easier to send each
    transaction as one packet (and split into multiple packets if that is needed
    in order to keep within max_allowed_packet).
 3. Optimizing the binlog by removing BEGIN/COMMIT events. When we have the
    length field, we can use that to detect transaction boundaries. Then the
    BEGIN/COMMIT become less important.
 4. Expose transaction size to the user through performance_schema tables.