Handle deleted objects in signal callback (fixes #168).