Add support for threadnames on BSD, Windows (MSVC-only), and OSX