Windows/OS X cross builds, a few more fixes

Just a few more fixes to consider, while doing cross builds: https://github.com/NixOS/nixpkgs/pull/1928

PS: Some changes might not seem to be directly related to cross builds, but happened to me while i was doing cross builds, so i put them here :)