Smoking cannabis ‘helps addicts give up heroin’, study finds