[Core] Fix all the warnings
[Core] Fix TargetFramework race

If something tried to request an unknown TargetFramework during
TargetRuntime initialization, then the framework collection could
be altered while being accessed.