Fixed #21952 -- signals deadlock due to locking + weakref interaction