Implement and lightly test headnode_delete