throw exception when calling getProperties from item context.

Fixes JENKINS-22708. If a context closure contains the getProperties() method, there is a stack overflow. Overriding the getProperties method fixes the issue.