People around the world are living longer, but many are also living sicker lives for longer, according to a study.