Enable building SSL/crypto libraries with MinGW

Previously <winsock.h> was getting included (through <windows.h>) before <winsock2.h>, causing an error in <ws2tcpip.h>.
Fix a number of file-related errors on MinGW

When built under MinGW, several other modules depend on "_fileno" instead of the no-underscore variant.
Fix the fix

Missed removing a line, breaking builds for all systems.