Add MSBuild project file

Intended to be used by a windows CI system like http://www.appveyor.com/

Also fixed a few recent things that broke the windows build.
TIL: windows has '#define small char', no in_addr_t and no truncate() function.