Corrected a try/finally lock release bug