api.resolve_path: split paths by both kinds of slashes

So that anything possibly relying on backward-slashes on windows
would still work.