Replace Windows specific thread handling

Use the platform independent primitives instead.
diff --git a/common/rfb/KeyRemapper.cxx b/common/rfb/KeyRemapper.cxx
index d33f0a4..b4c2793 100644
--- a/common/rfb/KeyRemapper.cxx
+++ b/common/rfb/KeyRemapper.cxx
@@ -17,6 +17,9 @@
  */
 
 #include <stdio.h>
+
+#include <os/Mutex.h>
+
 #include <rfb/KeyRemapper.h>
 #include <rfb/Configuration.h>
 #include <rfb/LogWriter.h>
@@ -27,14 +30,21 @@
 
 KeyRemapper KeyRemapper::defInstance;
 
-#ifdef __RFB_THREADING_IMPL
-static Mutex mappingLock;
-#endif
+KeyRemapper::KeyRemapper(const char* m)
+{
+  mutex = new os::Mutex;
+
+  setMapping(m);
+}
+
+KeyRemapper::~KeyRemapper()
+{
+  delete mutex;
+}
 
 void KeyRemapper::setMapping(const char* m) {
-#ifdef __RFB_THREADING_IMPL
-  Lock l(mappingLock);
-#endif
+  os::AutoMutex a(mutex);
+
   mapping.clear();
   while (m[0]) {
     int from, to;
@@ -59,9 +69,8 @@
 }
 
 rdr::U32 KeyRemapper::remapKey(rdr::U32 key) const {
-#ifdef __RFB_THREADING_IMPL
-  Lock l(mappingLock);
-#endif
+  os::AutoMutex a(mutex);
+
   std::map<rdr::U32,rdr::U32>::const_iterator i = mapping.find(key);
   if (i != mapping.end())
     return i->second;