fix pidfile cleanup if pidfile hasn't been written