A portrait of Alan Turing created by a robot has been auctioned for more than £800,000 and made history in the process.