Merge pull request #338 from denis2342/threadname small patch to add names to threads, should work for linux, freebsd and osx