J.C. Penney is on course to emerge from bankruptcy by Thanksgiving, after a U.S. bankruptcy court approved the sale of the ailing 118-year-old retailer to its two largest landlords and its primary lenders.