Count the number of threads during tests to find leaks. #2936

Implemented this when trying to diagnose 3217 (too many open file handles again)

The Coroner now prints thread counts at test start (current) and test end (current, diff and peak)