[runtime] Fix the order of how we fix types during appdomain unload. Fixes #17977.