Artificial intelligence is catnip to cheque-wielding politicians. But their investments won’t pay unless we stop hawking patents