It seems that there is a problem between the Windows 10's Anniversary Update, Avast Antivirus and the latest generation of Intel processors. A huge amount of users reported a "system thread exception not handled" BSoD error when they were trying to install the Anniversary Update with Avast running on their computers. Seeing the growing number of complaints on its forums, Avast finally acknowledged the problem and is currently working to solve it.
According to Petr Chytil, a quality assurance director for Avast, "The issue really seems to occur only on the last generation of Intel CPUs. [...] Previous generations of Intel Core CPUs are fine. Moreover, it did not show up during the testing on the Win 10 preview builds." Unfortunately, since this problem didn't appear for the Windows Insider users, the antivirus company was caught completely unprepared and there's no convenient fix just yet. At the moment, if you want to update, the only solution is to uninstall Avast from your PC and only then install the Windows 10 Anniversary Update. However, if you reinstall Avast once the updating process is completed, the BSoD will reappear, so you will need to wait until the security company comes up with a fix.