Set relative path root in js version of hack

Reviewed By: @int3

Differential Revision: D1732315

Signature: t1:1732315:1418253837:9bf5b3c803b235877c73db8a4f6e7904c4550499
Make ast destruction less recursive

Summary: ast nodes can have a pointer to a canonical node which
allows a certain amount of cse and constant propagation. These could
chain through the elements of an array, with the result that when the
array is destroyed, the last element keeps all the other elements alive,
and when its finally destroyed, we recursively walk the canonPtrs
destroying the elements.

This just clears all the canonPtrs in the destructor of ExpressionList,
which should prevent most pathalogical cases of this.

Reviewed By: @jdelong

Differential Revision: D1731406
Improve thread hooks

Summary: Also fix a couple of leaks on thread exit.

I don't think we're being bitten by the leaks right now, because
the only threads that are created/destroyed a lot are created using
std::thread, which bind directly to pthread_create etc, bypassing
our wrappers.

But I didn't like the way we had to sleep/retry to get hold of the
thread info from the map. So this passes the PthreadInfo as the
argument to the start function.

Reviewed By: @jasone

Differential Revision: D1731592

Signature: t1:1731592:1418245780:1ef8a7414641474036d0c76d3fc875693ca55ec1