(#13858) Use current environment when loading types
When loading a type we should pass in the current environment. This will make
the autoloader use the correct modulepath. Without this it will fail to find
the type unless a local pluginsync has already occurred on the master.