3e5ce23c99introduced a regression in case the freed Main was part of a list, and was supposed to be removed from it, since calling `BLI_remlink` does _not_ clear the `prev`/`next` pointers of the removed link. This commit also contains a few more tweaks to recent relatedb3f42d8e98commit. Pull Request #105485