refactor tcp server
- extract creation of listen socket
use goto on_error pattern to simplify TcpServer_Listen()