Fix race condition resulting in a crash when the MSTicker's time_func is updated from a thread which is not the ticker's thread.
Fix race condition resulting in a crash when the MSTicker's time_func is updated from a thread which is not the ticker's thread.