Thread dumping stats added to plugin

There are also comments warning about the delay of thread dumping
with an alternative written.