Fix ref counting for globals when set from java code.

Change-Id: I415b6ddeaab277e60233e905a6bae357cd5193eb
6 files changed