fix Issue 10736 - Regression (2.064 git-head): Instantiation failure triggered by module import and module order

In the reduced test case, `test10736b` instantiates `chunks` template
function, then it instantiates `Chunks!(int[])`. The instance object will
be inserted to `test10736a` member because it is the first module that
importing `test10736c`. But in this time, `test10736a` module's semantic3
is already done, then `Chunks!(int[])` would immediately invoke its
semantic3, then `Chunks!(int[]).opSlice` refers *not yet instantiation
finished* `chunks` template.

To avoid the forward reference problem, we should defer semantic3 of
template instances which inserted to module scope.
fix issue 10744 - Rejects valid interface inheritance + wrong error
message
Merge pull request #2451 from hpohl/10744

[REG2.064a] fix issue 10744 - Rejects valid interface inheritance + wrong error message
Merge pull request #2442 from 9rnsr/fix10736

[REG2.064a] fix Issue 10736 - Regression (2.064 git-head): Instantiation failure triggered by module import and module order