Sex link to older people's brain power, says study