[TIMOB-13162] Functions assigned to proxy property may be garbage collected

See problem details in the corresponding JIRA issue.