Fix usage of already closed Kiji resource.