Update ./.gitignore to ignore LEX generated files
Fix seg-fault with network_clear

In network_clear, a linked-list of channels is iterated through to free
them, however the 'tmp' (next) node was always being freed instead of
the current, resulting in a seg fault when 'tmp' became NULL. The fix is
to free the current node instead.