What very few people seem to point out about these stories of computers taking over and, indeed, in any of the films about machines dominating man is that by the time we're able to create AI and autonomous machines we'll also be able to augment humans.
Yes, I think there will come a time when there is an intelligence that is smarter than a human, and that it will eventually become supremely intelligent. I also think that while this will not make humans extinct, that it won't try and exterminate us and, more importantly, humans will evolve to extend our own abilities both physical and mental.
By the time AI is born we'll be able to replicate thought patterns to the point where we can download our own brains and personalities, at which point we'll become immortal, but we'll also be able to enhance our capabilities outside our bodies and inside to mean we can keep pace with any AI.
Likewise, by the time we can write 'unstoppable' viruses we'll be able to write automated anti-virus programs. I'm always surprised someone doesn't use the same techniques virus writers use now to eliminate viruses. I assume it's because there's more money to be made in anti-virus software.