fixes infinite loop in mutex dtor