someone on stackoverflow suggests:
val kiji = Kiji.Factory.open(uri)
val table = try {kiji.openTable("words")} catch {e: Exception => kiji.close(); throw(e); }
val writer = try {table.openTableWriter()} catch {e: Exception => kiji.close(); table.close(); throw(e);}

but that's actually more confusing, and less conventional to me. Anyway, not that big of a deal, but if you have other ideas I'd like to know.