After much testing Avast with Thunderbird I have come to a conclusion. That conclusion is that none of the Betas of Thunderbird above 17 release works with Mail Shield "Scan Secure Locations" activated. I have decided that Avast works well with version 17 the release version, so I will not use the Thunderbird betas until Avast updates Avast to work with the upcoming 18 which will be released in a few weeks. If 18 is released and Avast isn't updated IMAP mail will stop being delivered.
HINT: To Avast developers, time to test a beta of Avast for Thunderbird above 17.