make unix domain sockets work (and do few lines of backporting from gunicorn)