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.