Bug 858176 - Free global reference before detaching the JVM. r=blassey