syscall: handle varied path lengths for unix sockets
syscall: handle varied path lengths for unix sockets

Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.

Fixes issue 6627.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/46420044

firebitsbr/golang-old,wesolows/golang,wesolows/golang,wesolows/golang-old,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang-old,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang,wesolows/golang,wesolows/golang,wesolows/golang-old,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,wesolows/golang-old