It doesn't. The legacy entries are created by the operating system itself - and when the operating systems "decides" that they should disappear, they will (which is not necessarily at the moment you uninstall avast!). So, these entries were not directly created by avast!, and they are not supposed to be removed by the user.
Thanks Igor. Living and learning...
I've deleted myself a lot of legacy entries in the past... taking the ownership of the key.
You've said that
when the operating systems "decides" that they should disappear. This could be a long time in some cases