DISTS: Add .gitignore file

It contains some MSVC generated files, as well as an auto-
generated file containing the git version number (for non-
autotools builds, i.e. MSVC)
COMMON: add a better workaround for {,v}snprintf

Since Microsoft's functions are not C99 compliant, we use a
workaround by Valentin Milea found here:
http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010