Make main arguments not global

Make main arguments(i_address, p_port, flags, sws_dir, c_dir) not global.
Fix a memory leak in net.c.
Fix the redefination of SIMPLE.