Fixes exception when onOSGiConnected is executed not from the UI Thread.