lib: intro xdg_basedir

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: add test for xdg_basedir

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Merge: xdg_basedir

Will also be used to implement #559.

Pull-Request: #570
Reviewed-by: Jean Privat <jean@pryen.org>