Bug 856006 - Attempt no. 2 to fix orange in browserElement_KeyEvents.js.

It looks like we're sending events to the mozbrowser iframe before it's fully loaded.
Bug 857653 - Fix leak in AudioChannelAgent by making it hold a weak ref to nsHTMLMediaElement. r=bz
Bug 857152 - Make IPC channels more robust against use after being closed.

This patch makes three changes.  The goal of these changes is to prevent
IPC channels from crashing if you try to send a message across one after
the channel has been closed.

1. Each message_loop object gets a unique, non-repeating ID.
AsyncChannel uses this ID, instead of a pointer to the message loop, to
assert that it's being used on the correct thread.  This allows
AsyncChannel to assert that it's being used on the correct thread after
it's cleared its pointer to the thread.

2. AsyncChannel::mMonitor isn't cleared in AsyncChannel::Clear.  There's
no reason to do so; the monitor can get cleared when the channel is
destroyed.

3. AsyncChannel's mListener pointer is changed to a mozilla::WeakPtr.
This allows us to keep the mListener reference around longer, whereas
before we cleared it in AsyncChannel::Clear.

Channels try not to crash if you Send() on them after they've been
closed, but in practice they'd dereference mListener and mMonitor before
checking whether they'd been closed.

Note that weak references are not threadsafe, so if
mListener->asWeakRef() was called on a different thread than the one
that ultimately destroys AsyncChannel, we'd have a problem.  But I don't
think this happens.
Bug 857833 - Remove some warnings in toolkit/xre/nsAppRunner.cpp.
Bug 857834 - Remove a warning in the startupcache.
Bug 844323 - WIP: Move procesprioritymanager to main process.

Don't forget to remove ProcessPriorityManager-old.cpp
Bug 844323 - ProcessPriorityManager tests.
Adding test_Visibility.html.
Use a pref to in nsHTMLMediaElement to control whether we talk to the audio service.

Previously, we used #ifdef B2G.  Using a pref allows us to write mochitests which run in desktop Firefox that test the audio service and its interaction with other components.
Adding audio process priority test.
Adding test_MultipleFrames.
Remove XXX comment in ProcessPriorityManager.
Switch xpcom/base/StaticPtr from NULL to nullptr, and add a necessary include.
Change ProcessPriorityManager's export directory.

It was mozilla/dom/ipc/ before, but this changes it to mozilla/, which matches the file's namespace.
Move process preallocation logic out of ContentParent and into a new file, PreallocatedProcessManager.

Also make the PreallocatedProcessManager respond to pref changes.  This allows us to write a test involving the preallocated process.
Add test_Preallocated.
Make CurrentProcessIsForeground work.
Adding WebGLContextLoss test.