Thomas Smith, whose name remained on ballot, beats Republican rivals in primary contest for eighth district