The president’s involvement is a sign that Democratic leaders are taking down-ballot contests more seriously than in past elections.