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.