core: add a facility to execute functions on the main io_service

Change-Id: I38e5f4ad5ed6798a14e0075fb7a14b792f8b2413
refs: #4683
diff --git a/tests/rib-io-fixture.cpp b/tests/rib-io-fixture.cpp
index ef228d5..d058851 100644
--- a/tests/rib-io-fixture.cpp
+++ b/tests/rib-io-fixture.cpp
@@ -35,6 +35,9 @@
   std::mutex m;
   std::condition_variable cv;
 
+  g_mainIo = &getGlobalIoService();
+  setMainIoService(g_mainIo);
+
   g_ribThread = boost::thread([&] {
     {
       std::lock_guard<std::mutex> lock(m);