Automatically clean up key directory when an object is deleted.