Windows compatibilty patches (rebased to develop)

copy of https://github.com/DennisOSRM/Project-OSRM/pull/979
with `develop` as  base branch.

Dang! MSVC is more brittle than it appears. Nevertheless, we should return 0 here, i.e. stuff works as expected.