An analysis of more than 3.6 million mother-child pairs has found children born to obese mothers have double the risk of developing autism and ADHD.