7161732: Improve handling of thread_id in OSThread

Reviewed-by: dholmes, kamg
11 files changed