test_scripts/tcp_echo_server.pl: fix resource leak