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```
* Added ```p_``` prefix to ```strcasecmp``` and ```strncasecmp```. They're POSIX after all.
* 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.

This seems to be an addition. Do we use this anywhere?