Chimpanzees and orangutans may experience a U-shaped curve in well-being similar to that in humans, a study suggests.