Operating system restart needed by avast message could be solved, in some systems, by deleting the file <avast>\setup\reboot.txt
If deleting reboot.txt doesn't stop the requests for reboot check this:
Check this registry entry (right after computer restart):
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager, if it contains "PendingFileRenameOpertaions".
Check its contents and if there's only "reboot.txt" from avast4\setup folder, delete PendingFileRenameOperations, don't delete any other key.
Back-up (export) the registry key before you edit/delete, just in case.
Not sure what the problem with your shutdown might be (does this happen every time?), there could be something running that isn't ending correctly. Hopefully something may be in the windows event logs.