The happiness we seek may require investing earlier than we think—and may help us align our expectations and reality at the end of life.