NodeStore: Prevent modification of linked list while iterating over it, closes #108, closes #109.

Complexity of `node_store_add_wire` is now O(n^2) worst case.
WireItem: Cleanup the wire itself too.

This feels wrong and cleanup should probably be done somewhere else.