Issue #189: better manage thread pools

Stats thead pool as left alive after cache manager shutdown before this patch. While I was a it, I also cleaned up the events thread pools' lifecycle.
From looking longer, it can stay for the moment