There are over six million Americans with heart failure who are at greater risk of losing their cognitive abilities earlier in life, a study suggests.