Refactor mysqlctl for GTID support.