Implement and lightly test headnode_delete
Test headnode deletion more

Test that deleting a running headnode works correctly.
Merge pull request #288 from gsilvis/fix-headnode-delete2

Implement and lightly test headnode_delete