Personal note: If you encounter magically duplicating virtual folders in thunderbird check whether you there are any blanks or other Non-ASCII characters in your folder name. If this is the case switch the name to standard ASCIII characters and no blanks.
Explanation: In case of blanks or other Non-ASCII characters upon restart thunderbird escapes these characters in various ways leading to said duplicate entries. You can find the various entries in the virtualforlders.dat file and the corresponding msf-files in your IMAP mailbox. Deleting these entries solves the problem for a moment. Yet, unfortunately only up to the next restart of thunderbird.