Comment out logging
Better handling of potential null
Fixed lockup bug in ReferenceQueue processing

Stupid bug in the processing of the ReferenceQueue which would
lead to lockups if there was an odd number of entries in the
ReferenceQueue.  Caused by failing to read the docs properly,
refactored to correctly dequeue references from the reference
queue using while ((ref = q.poll()) != null) {}