Remove CR/LF line endings introduced when porting to windows.
Fix prematurely truncated stack traces in sampling profiler.
Don't access TLS slots in statistical profiler code.

1. The domain isn't actually used at all when writing the data.
2. On linux TLS access is unsafe to do in a signal handler.