Stanley Kubrick lyfte fram de potentiella farorna med AI långt innan det blev verklighet.