Location: C:\Windows\Temp\_avast5_
I've found out that Avast Web Shield stores temporary files here for some reason. Those temporary files are being detected by other AV's (on-demand).
What is the purpose of this? I thought Avast Web Shield aborts the connection?
Its purpose is plain, that is where the http port 80 traffic is scanned before being allowed to be saved into the browser cache if clean. If a detection is made, the connection is dropped and the file in the temp folder is cleared.
This is also where other shields unpack files that are to be scanned, so what you are seeing is a conflict between two scanners. You say this is an on-demand scan by another AV (which one), now the problem is that when you run another scan, that forces avast to actually scan that file first (duplication of scanning).
Now that _avast5_ folder once avast has scanned its files, the unp*****.tmp files is cleared so there shouldn't be anything in it for another AV to scan on an on-demand scan. So I would have to question if this is truly an on-demand AV (why we have asked what it is) or why this folder isn't being cleared by avast after a scan. The most common cause of this I believe is hooking by another security application so they are locked and avast can't clear them.