tpool: Windows compatibility, fix ResourceWarning. Thanks to

Signal socket bind to 127.0.0.1, '' does not work on Windows
sock.close() to fix ResourceWarning with python3 -Wd