As long as ur keg stays pressurized u don't have to worry about anything getting in and ruining it. Not sure what the warm up will do to it though. I think u'd be ok though since sunlight won't be able to get to it either. Shouldn't make it much different then a keg sitting in warehouse for awhile since ur keeping it pressurized with CO2.
Caveats: if the closet is cool. If the beer is filtered.
The issue I've found is that my beer is not stable. Even though my process is relatively clean long term warmish storage degrades the beer. I presume it's residual critters and yeast that keep working at higher temps. YMMV.