Resolves bug #3450 (Improperly cleaning up resources in DllMain)

Avoids freeing resources in DllMain on Windows in the case where the whole process is terminating.  According to Win32 API documentation, it is not legal:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583.aspx

Resolves bug #3450.