ipdb: more locks to protect critical operations