Representative Seth Moulton of Massachusetts has dropped out of the presidential race, ending a candidacy that emphasized Mr. Moulton’s centrist politics and military service but gained no traction with Democratic primary voters…