Fix Module::Architecture and Module::Platform factories

[#56005352]

Make sure module architecture and module platform factories can't
generate module instance with targets to prevent the module architecture
and module platform from the called factory from colliding with those
from the target factories.