In a master / slave setup with a separate dtabase server, $conf["dbmaster_host"] and $conf["db_host"] can not be identical. If they are identical in your setup, its a problem how you setup your server and not with the code.
Is there any reason for this double check to be here? I would assume that the fact that a master server is present should be enough to use it.
Yes, it is. The slave will and shall not have permissions to write to the amster server db except of the log table.