Avoid relative paths being used as root paths
Summary: Solves T28735 . A trailing slash was added to the filename path (not the filename) regardless of it being empty. This caused the following filename to be interpreted as a root path. Now, the OS-dependent separator is added only if the path is non-empty
Test Plan: See T28735
Reviewers: O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, kislinsk
Reviewed By: O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, kislinsk
Subscribers: kislinsk
Differential Revision: https://phabricator.mitk.org/D577