Made access to the wnd struct thread-safe.

diff --git a/windows/defdlg.c b/windows/defdlg.c
index 5ad889e..95052cb 100644
--- a/windows/defdlg.c
+++ b/windows/defdlg.c
@@ -215,6 +215,7 @@
                             SendMessageA( wnd->parent->hwndSelf, 
                                             CB_SHOWDROPDOWN, FALSE, 0 );
                     }
+                    WIN_ReleaseWndPtr(wnd);
                 }
             }
 	    return DefWindowProcA( hwnd, msg, wParam, lParam );
@@ -287,6 +288,7 @@
             case WM_ENTERMENULOOP:
             case WM_LBUTTONDOWN:
             case WM_NCLBUTTONDOWN:
+                WIN_ReleaseWndPtr(wndPtr);
                 return DEFDLG_Proc( (HWND)hwnd, msg, 
                                     (WPARAM)wParam, lParam, dlgInfo );
             case WM_INITDIALOG:
@@ -296,9 +298,11 @@
                 break;
 
             default:
+                WIN_ReleaseWndPtr(wndPtr);
                 return DefWindowProc16( hwnd, msg, wParam, lParam );
         }
     }   
+    WIN_ReleaseWndPtr(wndPtr);
     return DEFDLG_Epilog(dlgInfo, msg, result);
 }
 
@@ -344,6 +348,7 @@
             case WM_ENTERMENULOOP:
             case WM_LBUTTONDOWN:
             case WM_NCLBUTTONDOWN:
+                 WIN_ReleaseWndPtr(wndPtr);
                  return DEFDLG_Proc( (HWND)hwnd, msg,
                                      (WPARAM)wParam, lParam, dlgInfo );
             case WM_INITDIALOG:
@@ -353,9 +358,11 @@
                  break;
 
             default:
+                 WIN_ReleaseWndPtr(wndPtr);
                  return DefWindowProcA( hwnd, msg, wParam, lParam );
         }
     }
+    WIN_ReleaseWndPtr(wndPtr);
     return DEFDLG_Epilog(dlgInfo, msg, result);
 }
 
@@ -401,6 +408,7 @@
             case WM_ENTERMENULOOP:
             case WM_LBUTTONDOWN:
             case WM_NCLBUTTONDOWN:
+                 WIN_ReleaseWndPtr(wndPtr);
                  return DEFDLG_Proc( (HWND)hwnd, msg,
                                      (WPARAM)wParam, lParam, dlgInfo );
             case WM_INITDIALOG:
@@ -410,8 +418,10 @@
                  break;
 
             default:
+                 WIN_ReleaseWndPtr(wndPtr);
                  return DefWindowProcW( hwnd, msg, wParam, lParam );
         }
     }
+    WIN_ReleaseWndPtr(wndPtr);
     return DEFDLG_Epilog(dlgInfo, msg, result);
 }