Fix file separator bugs and dirname

The dirname function is not platform-friendly for Windows, not
understanding that on Windows a backslash is a valid separator. In
addition, the powershell exec used a command which didn't work correctly
with forward-slashes.

This commit provides a new function unzip_dirname() which is
target-platform sensitive, and updates the powershell syntax to deal
with forward slashes.