Engine: add close listener, to prevent NPE on shutdown in HTreeMap Cache.