Bug 955888. Part 1: Add ChaosMode.h base functionality. r=waldo

--HG--
extra : rebase_source : e892a951a3d3951e70e00f0b51046b744140eeee
Bug 955888. Part 2: In chaos mode, sometimes yield just before dispatching an XPCOM event. r=bsmedberg
This gives other threads a chance to beat us in a race to dispatch an event to
this event queue.

--HG--
extra : rebase_source : ca19bb52281837762bce43481b3393cd2ecf6679
Bug 955888. Part 3: In chaos mode, give threads randomly chosen priorities, and pin some threads to CPU 0 so they compete for CPU. r=bsmedberg

--HG--
extra : rebase_source : 77201ddade499250cbc81b6a582ce29a970c4a2a
Bug 955888. Part 4: In chaos mode, put new sockets at a random position in the poll list. r=jduell
This means sockets are processed in a semi-random (but consistent) order during
a poll.

--HG--
extra : rebase_source : 46d1e0bcdde73fc2e0886294f90df4b8eb93af62
Bug 955888. Part 5: In chaos mode, insert an HTTP transaction into the pending queue at a random position among transactions with the same priority. r=jduell
This effectively means HTTP transactions issue in a random order but priorities
are still respected.

--HG--
extra : rebase_source : 04e3888eee67ca2985d0307ac86c24cfa66de6a8
Bug 955888. Part 6: In chaos mode, when reading from an HTTP connection, sometimes read less than the full amount of available data. r=jduell

--HG--
extra : rebase_source : aab04fbb2a52c7b89dda30410b77bb323fd80de6
Bug 955888. Part 7: In chaos mode, start hashtable iteration at a random entry. r=jorendorff

--HG--
extra : rebase_source : f7e5208595171b0a7d58d9b8a91bc91a40725079
Bug 955888. Part 8: In chaos mode, vary timer duration (while respecting order of firing). r=bz
We also ensure that the mean timer duration is unchanged.

--HG--
extra : rebase_source : 21a43c2c6a0f677263464b8a23c5f605e36b9d06