EU general elections could be at risk to cyber attacks from foreign powers, according to the EU security commissioner.