Stop running semantic3 for unittests in non-root modules

This is important due to avoid out-of-memory error with `-unittest -inline`. Currently front-end inlining requires running semantic3 for all imported modules to analyze expanded function body code. By this change, we can remove the Phobos unittest analyzing cost in user application compilation.
fix Issue 10985 - Compiler doesn't attempt to inline non-templated functions from libraries (even having the full source)
Merge pull request #2561 from 9rnsr/fix10985

Issue 10985 - Compiler doesn't attempt to inline non-templated functions from libraries (even having the full source)