winpthreads: always return 0 in pthread_check() if the thread ended is 0

The code does the same but in a cleaner way, making room for the next patch.

Signed-off-by: Liu Hao <lh_mouse@126.com>
diff --git a/mingw-w64-libraries/winpthreads/src/sched.c b/mingw-w64-libraries/winpthreads/src/sched.c
index 75a579d..bdd4301 100644
--- a/mingw-w64-libraries/winpthreads/src/sched.c
+++ b/mingw-w64-libraries/winpthreads/src/sched.c
@@ -93,13 +93,13 @@
   if (!t)
     return ESRCH;
   pv = __pth_gpointer_locked (t);
+  if (pv->ended == 0)
+    return 0;
   if (!(pv->h) || pv->h == INVALID_HANDLE_VALUE)
   {
-  	if (pv->ended == 0)
-  	  return 0;
         return ESRCH;
   }
-  else if ((!GetHandleInformation(pv->h, &dwFlags) && pv->ended))
+  else if (!GetHandleInformation(pv->h, &dwFlags))
         return ESRCH;
   return 0;
 }