Make tests run under FreeBSD with gmake
Pass correct length for socket name
Fix line-endings
Correct handling of socket length