The mechanism I think is involved with the vanishing library can potentially be triggered by any background process that monitors the file system, anti-virus, anti-malware, continuous backup etc. Sony VIAO's have software that has caused the same kind of problem in the past, it has also been known to occur quite often during iTunes upgrades, and at random too. Of late there does appear to be a correlation with AVG, and for many people removing AVG has stopped the library repeatedly disappearing.However the random low level incidence of the problem won't have gone away.
May I ask why you believe there is a correlation between AVG and the disappearing libraries?
I ask because I've run AVG for years, and while it will go rogue once in a blue moon and suddenly classify things I've installed and use regularly as threats (for example, a few months ago it suddenly decided WoW was a Trojan and removed ALL of my game files) in every instance I've gotten a warning/alert and the action was recorded in the log.
Each time my iTunes library has disappeared AVG has been silent, and nothing is added to the log. Even when it blocks something fairly benign like a tracking cookie, I get an alert. If it's blocking scripts or removing files, shouldn't there be a record of the action? 😕