Resetting counter after unlocking Gc when a thread dies