I agree with moscafj's suggestion of starting with whole spices if you can. Aside from freshly ground spices tasting better, when you toast whole spices, they will reach temperatures that are far higher than those that are required to instantly kill E. Coli.
The temperature for toasting spices is a subject I've been pondering for years now... should all spices be toasted to the same temperature? How much of it is about time vs. temperature? Does my spice grinder get the spices hot enough to toast them, like how some blenders can cook hot sauce when it’s being processed? etc. etc.
In my anecdotal experience of years of always toasting and freshly grinding spices when I’m making curries, chillis, jerk chicken, etc. I’ve found that toasting the spices in a dry pan until they read ~115°C on my infrared thermometer, seams to be about right in terms of consistent, acceptable results whilst limiting the risk of a moment of distraction resulting in a ruined batch. If you want the absolute best flavour though, I’d point you in the direction of Heston Blumenthal. In his recipe for the ultimate Chicken Tikka Masala, or more specifically the Garam Masala he makes for it. He toasts the whole spices in a 130°C oven for sixty to ninety minutes... which results in a truly divine smell, let me tell ya.
The results are pretty incredible. The spices are exceptionally fragrant and because they’re free from moisture after their time in the oven, grinding them yields a very fine powder, which would be a plus in terms of texture if you're using them in something that is not cooked... but it takes a lot of time and electricity. So unless you’re making a large batch of curry powder and only using a small amount in your Coronation Chicken, I’d recommend toasting the spices in a small pan, as described. Just be sure to keep them moving.
If you don’t have whole spices, then you can still toast powdered spices but they’re much easier and more likely to burn. If all you care about is safety though, then getting them hot enough to kill the likes of E. Coli, is pretty low risk in terms of burning them. Another potential solution, if you're comfortable with the risks when making fresh mayonnaise, is that you could either bloom the powdered spices in warm oil, let it cool, and them make the mayo. Or you could soak the powdered spices in the vinegar. Acidification can inactivate and kill E. Coli but I can't give you precise figures on that subject.