Fix a problem with threads and the global database list in main.c. (CVS 2434)

FossilOrigin-Name: 4aa05d2251b0cf6323ea695330de9ccf7e071bed
diff --git a/src/main.c b/src/main.c
index 20335a0..42a031c6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.284 2005/03/29 03:10:59 danielk1977 Exp $
+** $Id: main.c,v 1.285 2005/03/29 23:34:58 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -531,8 +531,9 @@
 
 #ifndef SQLITE_OMIT_GLOBALRECOVER
   {
-    sqlite3 *pPrev = pDbList;
+    sqlite3 *pPrev;
     sqlite3OsEnterMutex();
+    pPrev = pDbList;
     while( pPrev && pPrev->pNext!=db ){
       pPrev = pPrev->pNext;
     }