path: Do not coerce paths to strings on Windows

Fix #4795