Then you can run by setting the memcached server to “/path/to/socket.sock:0″ in W3TC’s settings.

I’ve only tested this against the latest version (0.9.2.4) but it should probably work against older versions, though I have no idea how far back. In retrospect, it would probably be better to just check if the first character of the IP is a ‘/’ (who would use a relative path to a socket?) to avoid the stat call every time. Oh well.