Children who go to private school or a Russell Group university may have better health in mid-life, research suggests.