agent_connect_unix: make sure there's a trailing zero

... if the path name was too long. Reported by Coverity CID 89801.