To make marmalade, peel onions, halve, and thinly slice. Thinly slice 4 garlic cloves. In large, heavy saucepan, heat butter and oil over high heat. Add onions and garlic and stir to evenly coat. Sprinkle with sugar, fresh thyme, and red pepper flakes, and stir to dissolve sugar. Bring to a boil and then reduce heat to medium. Cook, uncovered, for 45 minutes, stirring occasionally. Onions are ready when juices have evaporated, and they begin to caramelize. Add wine, sherry vinegar, and Port and stir in. Continue to cook, uncovered, over medium heat for 25 minutes, or until liquid has reduced by two-thirds and onions are a deep mahogany color. Remove and cool. Add a pinch of salt, to taste, if you wish. Cover and refrigerate until ready to serve. Marmalade can be stored in the refrigerator for up to a week. Simply reheat before serving.