Merge "Fix ref counting for globals when set from java code."