compiler: fix calling class methods from a nested routine of a static class method (mantis #0024865)

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25274 3ad0048d-3df7-0310-abae-a5850022a9f2