[brucem] CRT thread fixups

Bruce: Please decide by yourself what to do with these. They should probably be merged into your branch.