Before this revision, unlinking a module which has been uninstalled at
least once would raise an Exception because base_module_uninstall
contains a field model_id which is required. The unlink method of
ir_module_module would try to set this field to NULL which is of course
a constraint violation.
This is fixed by manually unlinking the respective base_module_uninstall
records before the unlinking of the ir_module_module record itself
Fixes#20720
DO NOT FORWARD-PORT