Fix path handling when running the build process.

https://github.com/ariya/phantomjs/issues/12433