Bug 771765 - Support template content process, part 1: the Nuwa API and low-level wrappers. r=khuey

Support of zygote-like process forking is done as:
* The b2g chrome process forks a child process that will be the template for forking other content processes.
* The template process starts running to some point and freeze.
* When ready, the chrome process starts requesting the template to fork content proceses.
* The content processes forked from the template process recovers its states including the threads, file descriptors for epoll, signaling and IPC.

Recovery of the process states are done by wrapping some system and pthread calls to record the states in the template process and recover in the forked content process.
Bug 771765 - Support template content process, part 2: IPC and glue changes. r=bent

Changes include:
* Getting/resetting platform thread ID.
* Creating an IPC channel with existing file descriptor sent from the template process.
* Child process host with existing process forked from the template.
Bug 771765 - Support template content process, part 3: IPC glue and IPDL codegen to support protocol cloning. r=bent
Bug 771765 - Support template content process, part 4: Clone IPC protocol objects that will be up when the template process is ready. r=khuey, r=bent
Bug 771765 - Support template content process, part 5: PContent protocol changes. r=khuey, r=bent

Change the PContent protocol to support:
* Creating the template process.
* Forking new content processes from the template on the child side and cloning the actor on the parent side.
* Fallback to non-templated content process creation if no template-preallocated process is available.
Bug 771765 - Support template content process, part 6: support re-creation of the threads created in the template process. r=khuey, r=jorendorff

The threads that are frozen/recreated include:
* ImageBridgeChildThread.
* Image decoding thread pool.
* IPC thread (checkpointed, but not frozen).
* GC Helper thread.
* XPC runtime watchdog thread.
* Socket transport service thread/thread pool.
* Memory pressure watcher.
* Timer thread.
* DOM promise worker.
Bug 771765 - Support template content process, part 7: Don't schedule timer in the message pump if template process is ready. r=khuey
Bug 771765 - Support template content process, part 8: process initialization flow changes. r=khuey

Changes initialization code for the template process:
* Let the process run for NUWA_PREPARATION_TIME ms and then start freezing the threads.
* Delay android binder thread pool creation after the content process is forked from the template and other thread recreation has finished.
* Poke the app shell after the content process is forked from the template.
Bug 771765 - Support template content process, part 9: allocating a toplevel protocol should return itself. r=dzbarsky

Reverse the effect in bug 879475 part 14 since we need to keep track of open protocols in the Nuwa process.