Fix relative path resolution inheriting trailing slash flag from cwd.

This fixes a bug in resolving relative pathnames when
current working directory is target's root:
cwd is resolved to "/" which has trailing slash flag,
and this flag was inherited by the full resolved pathname,
which led to adding trailing slash to resolved pathname.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>