path: Do not coerce paths to strings on Windows

Fix #4795

Review, please: @sblom @piscisaureus