which posed a threat to the safavid and mughal empires