A scan which forms part of a routine eye test could help predict a person's risk of having a heart attack or stroke within the next 10 years, a study has suggested.