People who take opioids for six months or more to ease their pain after lung cancer surgery face a 40% higher risk of dying from any cause within the next two years, a new study suggests.