Go: fix overload functions with polymorphic

This bug can be re-produced when one of overloaded functions accepts a pointer to BaseClass but a pointer to DerivedClass is passed, and finally leads to application's crashing.

Test case is also included.
OK, that still shouldn't be part of an unrelated PR though (and has already been fixed on master).