Added missing terminate/1 callback and cache_adapter_*:terminate tweaks