Fix main-thread detector on Android