Add test for duplicate definition of promise handles

Promise handles should allow the use of variables without triggering
duplicate handle errors
Methods that do nothing are also verified/kept

Fixes Redmine #4852. If a bundle invoked via a methods promise
results only in skipped promises, then the methods promise is kept.

That this issue exists with the test case in the redmine ticket
suggests that file promises return inconsistent results here. A
promise to create a file when that file exists should return NOOP,
not SKIPPED.
Redmine#4852: ensure a kept bundle is reported correctly to the methods promise
tests/acceptance/16_cf-serverd/01_start: re-enabled allow_path1_then_deny_path2*
Fix leak on failed mustache templates
Merge remote-tracking branch 'nick/redmine/4682'
Fix static handle duplicate checking

Do not count handles with variable references. Do not count duplicate handles
attached to promises with different class expressions.

Close #4682
tests/acceptance/10_files/01_create/perms-mode.cf: add Windows-specific permissions
libpromises/generic_agent.c: log only parsing errors in VERBOSE; missing file (-f case) in DEBUG
new autoconf option to make state directory configurable: --with-statedir=<directory>
Make use of preprocessor macros for static known_dirs.c functions
rename MAX_WORKDIR_LENGTH macro to more generic MAX_DIR_LENGTH
add GetStateDir() and supporting functions
make use of GetStateDir() and replace hardcoded state/ paths
RemoveDates():
- use sizeof on datetime string literal to move computation to compile-time.
- comment on uncertainty of two-digit hh:mm:ss and time-zones shorter
  than three letters.

Pointed out by Edward Welbourne
LogTotalCompliance(): prevent cf-agent from bailing with custom logdir
adjust examples/measure_log.cf comment to account for compile-time statedir
MonNetworkInit(): use GetStateDir() and refactor
MonitorInitialize(): make use of GetStateDir()
make bootstrap.c functions, and their usage, respect GetStateDir()