Since whale oil was a frequent product of the past, how did whalers preserve their product on the journey home, which at times could be longer then the shelf life of a dead animal?
Whale oil itself will not mold or rot and even is fairly resistant to rancidity (more so even than most vegetable oils). This shouldn't be too surprising as it exists naturally in large volumes inside the whale and if it required a lot of upkeep or immune activity to maintain it would be very biologically costly. Typically a whaling vessel would process whales not long after they were killed and either extract the oil (from sperm wales) or butcher the whale and render the blubber into oil where it was then stored in a vessel in the ship. For blue whales the whalebone was kept as well as the oil, otherwise the rest of the carcass was left abandoned. One of the major selling points of whale oil was precisely its incredible stability in a variety of temperatures and its resistance to spoilage.
For other kinds of organic products from other sources the typical methods of preservation were used: salting, drying, and curing meat; use of stable foods like olive oil and honey; use of fermented or preserved foods like cheese, wine, dried fruits, etc.