Fix yet another race in the rpl_gtid_startpos test case.
Implement include/wait_for_purge.inc to purge binary logs; we need to
retry the purge multiple times until it succeeds in removing all the logs
we want, as binlog dump threads can be slow to stop on loaded machines and
hold back purge of logs that are still referenced by the thread.