Want to live longer? Be an optimist, study says