When purging nodes, only delete them if nobody references them anymore.