Fixed some issues with the SOCKS proxy code as it affected the entire processes socket calls going through the proxy, which is not what we want in some cases.