Flush temporary PID file after write