When CHANGE MASTER fails, it may or may not have already added
the Master_info * to the index. Implement logic that properly
handles removal and freeing in both cases.
With MDEV-532, the binlog_checkpoint event is logged asynchronously
from a binlog background thread. This causes some sporadic failures
in some test cases whose output depends on order of events in
binlog.
Fix using an include file that waits until the binlog checkpoint
event has been logged before proceeding with the test case.