defer recover if there is an exception when writing to a closed chan