[review] Close writer in finally block