Change path_directory

The function path_directory is changed to not add a '\0' byte
to the end of the returned path. If the return parameter
which is of type wbuffer_t wraps an object of type cstring_t
a null byte is automatically added.

Adapted callers of path_directory.

Implemented shrink_wbuffer(wbuffer_t*,size_t new_size);
for handling error cases. This function can remove content
appended to a wbuffer_t in case of an error.

Changed load_file to use shrink_wbuffer.

Removed the call to clear_wbuffer in all functions which returns a value
in a wbuffer_t. Now the return value is only appended to wbuffer_t and
in case of an error shrink_wbuffer is called with size as parameter
where size is set to size_wbuffer() at the beginning of the function.

Adapted any callers to these functions.
Check for resource leaks in execsingle_unittest

Function execsingle_unittest() now uses type
resourceusage_t to test for any resource leaks
the tested module may have.

Added new error code ELEAK. Function same_resourceusage
now returns ELEAK in case resources leaked.

Refactored error numbers into C-kern/api/errornr.h
and included it from C-kern/api/err.h.
Remove include resourceusage.h from unittest.h

The function execsingle_unittest already checks for resource leaks.
So in general any called unittest_XXX function do not need to test
for resource leaks on their own.