Fixing cross-compiling issue #456 setting windows path from linux

This fixes #456 by giving priority to os.Getenv("GOOS") (when defined) over runtime.GOOS. Couldn't fully test the changes against develop because of #747, but did manual tests against master.