WL#7796: WAIT_FOR_EXECUTED_GTID_SET

Affects: Server-5.7   —   Status: Complete

The function WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS has several shortcomings:
- The function is dependent on the slave to execute. If the slave thread is
  not running (or if is being stopped while the function is executed), then
  the function returns an error. It would be better if the function kept waiting,
  so that it could be used even when the slave is stopped.
- The function returns an event count. This is meaningless and not very
  well-defined. It would be better to just return 0 for success, 1 for timeout,
  and 2 for other failure (i.e., query killed).
- The function is ill-named.

In this worklog we introduce a better replacement:
  WAIT_FOR_EXECUTED_GTID_SET(GTID_SET [, TIMEOUT])
This function shall not care about slaves running and shall return just 0 or 1.