A longtime legal adviser of President Donald Trump warned the president in a phone call Friday that Michael Cohen, Mr. Trump’s personal lawyer and close friend, would turn against the president and cooperate with federal prosecutors if faced with criminal charges.