Voters defied threats from the Taliban and rocket attacks on Thursday in an election that has become a critical benchmark of the nation’s progress.