REST-116. Fix unclosed resources in InstanceCache.

issue: https://jira.kiji.org/browse/REST-116
review: https://review.kiji.org/r/1740