Fix for Mantis #26177. Use the correct value for the method data when using a method pointer of a type or record helper.

Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!

ncgld.pas, tcgloadnode.pass_generate_code:
  * only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)

+added test


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