If I were DMing the situation you describe, the animal companion would recieve the negative level just as a PC would (as an NPC would if you cast a level-draining spell), including lost HD (levels in the 'animal' npc class if you will). There is an entry in the Druid description of the PHB dealing with losing and regaining companions for just such a purpose, though, again if I were DMing, the druid should be wary of abandoning an animal that has recieved such trauma so recently without going to every extent to heal the lost levels if possible, or at the very least finding a perfectly ideal environment for the crippled creature to be released into (an unnatural affliction has come upon the druids' companion that would not have happened had the animal not been traveling with the druid, while completely unintentional, the druid would still be obligated to take responsability for the matter).
Sorry I couldn't offer some kind of loophole, but frankly I can't think of one, except to use every means at your disposal to cure your companion before the 24 hours pass. If the 24 hours has passed, your companion is slightly weaker, but also has fewer HD, allowing you to adopt more companions.