Save PID file correctly after the directory is created