Fix the dead thread bug on iOS 5 (fix #466)