build: check for snprintf during config for mingw cross compiles.
tests: check HAVE_SNPRINTF before defining.