Thinking about your own death can make you reach for the cookie jar.