Support building on Cygwin, fix gcc structure packing issues.

... under mingw32-gcc >= 4.7.