Moved debugger to libwine to make it available to WineLib apps.
Try to invoke external debugger if internal debugger crashes.
Try to handle early invocation of debugger more gracefully.

diff --git a/debugger/external.c b/debugger/external.c
index fb3deec..95c72ca 100644
--- a/debugger/external.c
+++ b/debugger/external.c
@@ -14,7 +14,7 @@
 #include <stdio.h>
 #include <string.h>
 
-
+#include "options.h"
 
 #define DBG_BUFF_SIZE  12
 
@@ -90,9 +90,9 @@
   if (child_pid == 0)
   {
     int  status;
-    char *dbg_external;
-    char *dbg_wine_location;
-    char *dbg_no_xterm;
+    const char *dbg_external;
+    const char *dbg_wine_location;
+    const char *dbg_no_xterm;
     char pid_string[DBG_BUFF_SIZE];    
 
 
@@ -107,7 +107,7 @@
 
     /* if not set in environment, use default */
     if (!dbg_wine_location)
-      dbg_wine_location = "/usr/local/bin/wine";
+      dbg_wine_location = argv0;
 
     /* check for empty string in WINE_DBG_NO_XTERM */
     if (dbg_no_xterm && (strlen(dbg_no_xterm) < 1))