Make new MingW work as cross compiler

Newer MingW define some macro and functions which are not suitable for
FreeTDS. Avoid using them but provide replacements.
Also fix helper script to build Windows distribution.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>