Fix sudo installation issue #3027

TIMEDIR is no longer used to refer to the timestamp state dir. This patch configures `rundir` / `vardir` instead.

Resolves Issue #3027.

Also use configure flags where possible rather than patching pathnames.h so that we'll get better errors if those items change in the future.