Allocate task instances in batches

We now allocate task instances in 8Kb batches.  This reduces the number
of times we have to call `malloc` when allocating a largish number of
tasks.  The concurrent_unbatched test case is now twice as fast.  Still
much slower than the others, because of how many tasks we allocate at
once before running anything.  But better than before.