client: fix potential buffer overrun in socket path