set the cmd socket to blocking mode, and wait for thread on exit