qga: determine default state dir and pidfile dynamically