Humanity must not entrust its lot to clever machines, the bestselling historian warns