remove unused get_free_random_port()
make new functions for getting and testing random ports
replace _obtain_port() with new method
improve network_utils.py functions
remove IPv6 from network_utils
simplify _test_port()
Merge pull request #691 from LipuFei/rnd-socket-lingertime

Fixes random port testing problem