Implement LDT hackery needed for threads on x86.