Add unit test for Path.toNativeString() w.r.t. endsWithSlash() and fix Path().toNativeString() on Posix.