Made threads robust - restart when they die and always give up locks if they die