Try hard not to break delete_path_obj()

Safely fixes bug 3274