Fix PPC bugs in core.thread.

Work around a LLVM bug and missing store of stack pointer.