SCORE-165. Fix resource leaks in tests

issue: https://jira.kiji.org/browse/SCORE-165
review: https://review.kiji.org/r/1686