(cherry picked from commit 9458a1abd3, modified by committer)
In the previous version of the test code, when attempting to listen for a UDP socket, the port availability check check for TCP port instead of UDP port. This make it possible to select a UDP port that is unavailable.
See Also: https://github.com/v2fly/v2ray-core/pull/1302