Enable -Wconversion for thread.cc

This should help prevent bugs due to unexpected implicit integer
conversions.

Some collateral changes were needed as well to limit the number of casts
that had to be introduced.

Bug: 165843530
Test: m test-art-host-gtests
Change-Id: I091122827001ab335c7e140864f67cdf90fcf8b4
9 files changed