Russia’s malign influence campaign during the 2018 elections was a rehearsal for the presidential campaign, the F.B.I. director warned.