The president gave a televised speech that featured repeated rants against Democrats and his predecessor, Joseph R. Biden Jr.