Preventing any customised changes that you make to your
Kunena template is an interesting challenge, to say the least. Basically, though, because
Kunena is an open source product, you are free to adapt it to whatever particular custom use that you may have. However, in tandem with this freedom, is the need to maintain those custom changes whenever you are in the situation of having to upgrade
Kunena from one dot-point release (or major version release) to the next.
Even though this may have no bearing on your current situation, before I describe the general technique that answers your question, I should like to offer a few words of caution. Most of us are aware of these pitfalls of "over customising"
Kunena - K 1.5 templates are totally incompatible for K 1.6 (for example) and this level of customisation has prevented some people from going forward despite the fact that K 1.5 is not really supported these days. When K 2.0 is released, within a few months, K 1.6 templates will also not be compatible with that new version. It is expected that only one or two dot-point releases of K 1.6 will be offered after the current release (K 1.6.4)
The solution is to build your own
Kunena template. The method is described in broad terms, although not particularly well written, in
Apart from using the "own template" idea, the only other way I can advise you to make sure you don't lose your custom category icons is to maintain your own backup copy somewhere and remember to put them back after you upgrade.
I hope this helps.