KIJIREPO-54. Clean up resource leaks in tests

issue: https://jira.kiji.org/browse/KIJIREPO-54
review: https://review.kiji.org/r/1844