Move c-string utility functions from Foundation to Platform
Use proper string copy for thread name, ensure proper thread name setting on windows