Adds <stdlib.h> to satisfy reference to abort.
build: Fixes check target for mingw.
test: Removes replacement snprintf for mingw.

Mingw has a proper definition of snprintf.
windows: Fixes code for MinGW, that still has non conforming swprintf.