Sanitize paths uniformly, in a Windows-friendly way.

Other solution is not Windows-friendly. This PR attempts to handle this difference.

Fixes kinda a #1948 thing.
Related to #1946.

/cc @gregose @alindeman @benbalter