A new poll pointed to a close race in a Democratic primary that reflects generational and ideological divides.