Revert "build: remove mingw makefile"

As requested by the Rust people.

This reverts commit 8f3621e4dd2d55befd0f0b8635cf8de17f849aff.
unix, windows: add thread-local storage API

Uses the pthread_key_{create,delete} and pthread_{get,set}specific
functions on UNIX platforms, Tls{Alloc,Free} and Tls{Get,Set}Value
on Windows.

Fixes #904.