WL#5795: Remove THD from Master class

Status: Un-Assigned

This is a step towards making replication a library, such that the 5.6 rpl-lib can 
be plugged into the 5.5 core [WL#5675].

We replace function arguments of type THD* by MYSQL_THD* for all functions the 
Master class. This is needed because THD is not stable.

We also add functions to core that read any information that Master needs from 
MYSQL_THD objects.