Bug fix in get_root_master

bug fix in get_root_master if there is a server outside of the
replication tree or not monitored