Xiaoqiang Wang proposed some fixes that allow static builds on the MinGW targets to succeed. Some additional changes made to blockingSockTest.cpp also clean that up.
Cherry-picked 3.15 revno 12398 with some changes.