Actually I think the opposite of this is true. Yeast create diacetyl as a byproduct during the first stages of fermentation, and then later on when things calm down they go back and clean up after themselves converting the diacetyl into other things. This is the reason people do diacetyl rests where they intentionally leave the beer on the yeast longer at a warmer temperature to encourage the yeast to clean up the diacetyl. I've never had off flavors from leaving beer on the yeast cake too long and from what I've read you would have to leave it for months or maybe years to notice anything bad. I leave my beers a minimum of 3 weeks and usually a month or two for bigger beers to give the yeast enough time to clean up.
This is partly correct. Diacetyl (tastes like butterscotch) is released during primary fermentation and is then reabsorbed by yeast and released as flavorless molecules. It doesn't take a month for yeast to do this, and diacetyl rests are typically a few days of increased temperature early in the fermentation process.
Talking about transferring to a secondary seems to really upset people on this forum..
Cell death and the resulting autolysis (cell degradation that releases molecules: fatty acids, degraded RNA/DNA, and proteins) takes a long time under normal "home-brew" conditions. You won't see this occur in healthy yeast until a couple months after the primary fermentation time. The reason being, the yeast is under a layer of beer covered by CO2, it isn't being agitated, and the ethanol % isn't high enough for rapid cellular death. That being said, if you reuse your yeast for multiple generations be careful about letting it sit that long if you want to avoid off-flavors. A small percent of yeast cells undergoing autolysis can have a detrimental effect on your final product.
those effects=bad head retention (from the fatty acids), off-flavors, and effects on mouth-feel
Not all molecules from autolysis are bad, I've done research and written articles on the positive effects of certain degraded RNA/DNA molecules on fermented beverages. For example, take your common sparkling wine that has been re-fermented in the bottle. Certain molecules from autolysis that release in that second fermentation greatly enhance desirable flavors and mouthfeel.
To the OP. Go ahead and add your spices to the primary. I would sterilize them by heat but if they're already really dry there is probably not enough water activity in them to promote microbial growth. In addition, after fermentation is complete, the beer has become a low PH and high ethanol environment that a lot of micro-organisms can't live in. If you do boil a small amount of water with the spices.. let it cool for a few minutes. A lot of yeast will be hanging out in the foam at the top of your fermenter. Unlikely as it is, I wouldn't risk killing any of them.