Men who had a history of asthma or eczema generally had a lower risk of developing cancer, according to a new study.