Relazione dell'Impero Ottomano nel 1573
Says that it was observed since the 14th century that opium was highly addictive.
"In 1573, for instance, a Venetian visitor to the Ottoman Empire observed many of the Turkish natives of Constantinople regularly drank a "certain black water made with opium" that makes them feel good, but to which they become so addicted, if they try to go without, they will "quickly die"
It was since Marx and still is being wiedly use as medicine today (though mostly in murica), that doesn't mean people are ignorant of the addiction of opium.
I'm also pretty sure all those doctors who died in their 50s were aware of the addictive side effects. Pretty sure Marx must have known if he knew which euphoric effect it had.