fix panic with unix socket

Fixes a bug mentionned in #1005