Compatibility/Portability cleanup

This PR cleans up the portability/compatibility layer and fixes a few benign warnings I've picked up while doing this:

* Fixed the include guard of ```unix/posix.h```
* Replaced all remaning ```snprintf``` with ```p_snprintf```. We had duplicate mappings of ```_snprintf_s``` to ```snprintf```
* The remaining little bit of ```define```'s in the mingw compatibility file had is actually general enough (not mingw specific) that it was moved directly into the top-level ```posix.h``` file.

I've tested the changes on mingw, MSVC (2008 + 2003 Platform SDK) and clang on OS X.