High blood pressure and diabetes impair brain function, study suggests