Track what linux calls "thread groups".

Hoped we could avoid doing this, but seems to be needed for #386.  Luckily, pretty simple though.