fix hang if using proxycommand

problem was introduced by commit 068bf63cf03d689187bede5c11b6c38ec2b2a8e1
when using a proxycommand, self.is_alive() loop in stop_thread never
ends

Don't know if it is the right way to do it, but, works for me