Fix potential buffer overflow reading the PID file.