Fixed various stupid bugs in services thread routines.
Added SERVICE_Exit routine to kill the services thread.

diff --git a/loader/task.c b/loader/task.c
index 3867770..4e1dcf2 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -36,6 +36,7 @@
 #include "debugtools.h"
 #include "dosexe.h"
 #include "dde_proc.h"
+#include "services.h"
 #include "server.h"
 
 DECLARE_DEBUG_CHANNEL(relay)
@@ -579,6 +580,7 @@
     if (nTaskCount <= 1)
     {
         TRACE_(task)("this is the last task, exiting\n" );
+        SERVICE_Exit();
         USER_ExitWindows();
     }