Two dying memoirists wrote bestsellers about their final days. Then their spouses fell in love.