Fix clang warnings / move some plat code into poly.
Moving threading utils to poly.