The head of MI6 has warned that artificial intelligence could accelerate cyberattacks, enable the development of dangerous weapons and outpace human ability to control it.