Artificial intelligence is pushing humanity toward a more efficient future, but like any world-changing technology will eventually crash and hurt investors, according to longtime Wall Street doomsayer Jeremy Grantham.