Former Representative Beto O’Rourke of Texas announced on Friday that he was dropping out of the presidential race, ending a campaign in which he struggled for months to recapture the energy of his insurgent 2018 Senate candidacy…