Bug 872013 - Use more robust mkdtemp() rather than relying on PID r=ehugg,jesup