I personally don't see a direct causal link between an infection and a more active tensor tympani.
But what could be happening, is that you are feeling quite distressed as a result of that infection. Coupled with some sleep deprivation, your emotional impact around sounds might be even stronger than usual, causing this highly psychosomatic muscle to be even more hyperactive than usual.
On the other hand, sound sensitivity may also increase, I think, as a response to an infection in the ear. You may have some mild hyperacusis going right now, because of it. That's why it may very well subside once you get that infection under control, as your ears will regain their normal sound thresholds again.