Implement and lightly test headnode_delete

headnode_delete now has this functionality. I think the intent was to put the responsibility of deleting a headnode in the users court if a failure occurs during creation. On a side note, project apply is referenced in the removed comment, which was weird because it doesn't exist anymore.