(external pull request)fix thread bug when not running linphone on the main UI thread but instead on a worker thread