bss_dgram.c,d1_lib.c: make it compile with mingw.

Submitted by: Roumen Petrov
test/Makefile: allow emulated test (e.g. under wine).

Submitted by: Roumen Petrov
dh_check.c: check BN_CTX_get's return value.