charm: close files in tests