If you want to clean those files you can disable all Avast shields on a temporary basis. Then go ahead and delete them. You can add the file/ folder location to your file cleaning program and run it or you can delete them manually. Then re-enable Avast shields.

This is not a bug. You can’t delete files when they’re in use. That’s all there is to it.