Try hard not to break delete_path_obj()

Safe fix for bug 3274