fix Issue 13476 - Writing stubs for dynamically loaded functions no longer works. (circular reference)
Merge pull request #3989 from 9rnsr/fix13476

[REG2.065] Issue 13476 - Writing stubs for dynamically loaded functions no longer works. (circular reference)