kdb: do not rely on PATH_MAX for getcwd

PATH_MAX is optional in POSIX, so can not be provided; isolate the
getcwd code in an own function that uses PATH_MAX only as initial hint,
enlarging the buffer as long as it is needed.
Add the KEY_END marker on key creation where missing

Add the KEY_END vararg where missing when creating a new key, either
using the C keyNew or the C++ kdb::Key, as done everywhere else.

This fixes crashes in some tests.
tests: switch from tmpnam to mkstemp

Use mkstemp to generate a temporary file in a safer way than tmpnam,
and placed in the temporary home created for the tests already.
xmltool: move testmod_xmltool.c to the top-level

No functional changes.
xmltool: change directory of tests data

Move the XML test data from the tests subdirectory to a new xmltool
one, installing it as a whole together with the other test data;
adapt testmod_xmltool and test_validate.sh to the new paths of the
test data.

This mimics how other plugins handle test data.
xmltool: remove now empty tests subdirectory
use KDB_MAX_PATH_LENGTH

- already does #ifdef for PATH_MAX and has a fallback
- some coding convention fixes
- make std::string conversion explicit
- give longer error message
- resize * 2 for less resizes
Merge branch 'pinotree-path_max'

See https://github.com/ElektraInitiative/libelektra/pull/43

PATH_MAX is optional in POSIX, so can not be provided; isolate the
getcwd code in an own function that uses PATH_MAX only as initial hint,
enlarging the buffer as long as it is needed.