Bring thread ops in line with desired API.

The thread code itself hasn't been touched for months, so will need
a good bit of work. Not to mention the places missing concurrency
control.
Don't inherit caller when starting a new thread.

Certainly, that doesn't happen on the JVM, and given most things run
on a thread pool thread in real code, it's not much use anyway.
Avoid frame pool out-of-bounds on new threads.
Create cur_usecapture on thread start, not alloc.
Typo.
Guard against adding a NULL to the worklist.
Don't blow up if asking for ID of starting thread.
Avoid duplicate additions to stolen work list.
Set up us the initial thread ID.
Block/unblock thread while sleeping.

This means another thread can do GC on its behalf, rather than waiting
for its slumber to end.
Correct freelist update code.

At least, this looks righter, and removes comparing two things that
are potentially unrelated memory addresses.
Remove unsafe gen2 sweep.

Nice try, but if we only nursery marked, it doesn't matter the thread
is going away, we still can't go assuming its gen2 objects are dead.
If it just so happens we already were doing a gen2 run then we'll get
the optimization out of existing code anyway.
Implement reentrant mutexes.

We can't rely on libuv ones to be reentrant, so we need to build the
recursion support ourselves.
Add Repr Semaphore
Fixed copy-pasto
Updated MAST::Ops library.

Forgotten in an earlier commit.
Comment tweaks.
Add semaphore related ops.
Implement ConcBlockingQueue REPR.

Uses separate head/tail locks and a condition variable for waiting for
the queue to contain a value. (The head/tail locks approach comes from
the Michael and Scott paper; naturally, any implementation errors are
mine.)
Mark thread as GC-blocked when waiting on a queue.