Bug 871783 - Do not copy the stack pointer for alignment checks. r=nbp

Test the stack pointer directly instead of copying it to
a temporary register. This is debug-only code, but tidiness is nice.
Bug 872013 - Use more robust mkdtemp() rather than relying on PID r=ehugg,jesup