loader: add helper for combining paths

Add a helper function to combine an arbitrary number of path elements,
separating them with the platform-specific directory separator, and
use it in places where path combining is currently achieved through
direct string manipulation.

As an additional cleanup, update loader_get_fullpath() to duplicate
the search path string internally, rather than relying on the caller
to do so. Since loader_get_fullpath() and loader_expand_path() no
longer modify input strings, and loader_expand_path() no longer
requires that the caller append the DIRECTORY_SYMBOL ahead of time,
acrobatics to duplicate strings to prevent modification and/or to add
directory separators are no longer necessary.

This change will result a behavior change on Windows: the existing
logic for loading an ICD that is specified as a bare filename, and
not as an absolute or relative path, is to search for a driver with
the given ICD name in the DEFAULT_VK_DRIVERS_PATH search path on
Linux, and to use the given ICD name as-is on Windows. This could
lead to DLL injection attack on Windows. Merge the Linux/Windows
behavior to limit the search for ICD filenames to the default search
path on Windows as well, which is also more consistent with the
behavior described in the loader spec.

Conflicts:
	loader/loader.c
2 files changed