Self-driving vehicles and internet-connected cars present fresh targets for hackers seeking to commit acts of terror, ransom drivers or simply wreak havoc on the roads.