Stop headnode before deleting it.