The shrinking size of whales over the 20th Century could help scientists detect when wildlife populations are in trouble, a study suggests.