Add stuff for older short-circuit impls

Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu>
replace %d with __PORT__

Signed-off-by: Colin Patrick McCabe <cmccabe@cloudera.com>
use /r/socks rather than /tmp for sockets

Signed-off-by: Colin Patrick McCabe <cmccabe@cloudera.com>