Fix invalid "double checked locking" in InflaterCache
We move the Inflater allocation out of the synchronized block as
it requires JNI code to build the libz structure. This permits
other threads to get into the Inflater allocation faster.
We also fix the release implementation to validate the array size
only after we enter the lock, rather than before. This prevents
us from releasing an inflater due to a stale copy of the open
count being in our processor cache.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>