Fix KeyError during lock reacquire (OMS-560)