People aged 40-79 are at significantly lower risk of long or frequent hospital admissions if they do some form of physical activity, a new study suggests.